题目内容

写出下列程序的执行结果是:__________________。#include using namespace std;void main(){ char s1[] = "Fortran" , s2[] = "Foxpro" ; char *p , *q ; p = s1 ; q = s2 ; while( *p && *q ) { if ( *p == *q ) cout << *p ; p ++ ; q ++ ; } cout << endl ;}

查看答案
更多问题

写出下列程序的执行结果是:__________________。#include using namespace std;void main(){ char *str[] = { "c++", "basic", "pascal" } ; char **p ; int i ; p = str ; for( i=0 ; i<3 ; i++ ) { cout << *( p+i ) ; if(i!=2) cout<<","; }}

写出下列程序的执行结果是:__________________。#include using namespace std;int f( int [][3], int, int ) ;void main(){ int a[][3] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 } ; cout << f( a, 3, 3 ) << endl ;}int f( int a[][3], int row, int col ){ int i, j, t=1 ; for( i=0; i

写出下列程序的执行结果是:__________________。#include using namespace std;int f(int [],int);void main(){ int a[] = { -1, 3, 5, -7, 9, -11 } ; cout << f( a, 6 ) << endl ;}int f( int a[], int size ){ int i, t=1 ; for( i=0 ; i0 ) t *= a[i] ; return t;}

写出下列程序的执行结果是:__________________。#include using namespace std;void main(){ int a[9] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } ; int *p = a , sum = 0 ; for( ; p

答案查题题库