2015年托福聽力備考技巧「最新」
選擇題
1:下列各語句定義了數(shù)組,其中一個不正確的是
2:設int x[] = {1,2,3,4,5,6},* p = x;則值為3的表達式是
3:執(zhí)行語句for(i=1;i++<4);后i的值是
4:union ty
{ int a;
int b;
} ;
main()
{ union ty t;
t.a=5;
t.b=4;
printf( “ %d,%d ” ,t,a,t,b);
}運行結果為
{ int a;
int b;
} ;
main()
{ union ty t;
t.a=5;
t.b=4;
printf( “ %d,%d ” ,t,a,t,b);
}運行結果為
5:執(zhí)行下列語句
int a=8,b=7,c=6;
if(ac){a=c;c=b;}
printf(″%d,%d,%d\n″,a,b,c);
后輸出的結果是
int a=8,b=7,c=6;
if(ac){a=c;c=b;}
printf(″%d,%d,%d\n″,a,b,c);
后輸出的結果是
6:設函數(shù)定義如下:
float f1 (float a, float b)
{
return (a+b);
}
若有float x=1.1, y=2.2;,則以下語句中正確的函數(shù)調用是
float f1 (float a, float b)
{
return (a+b);
}
若有float x=1.1, y=2.2;,則以下語句中正確的函數(shù)調用是
7:執(zhí)行語句“ for(s=0,i=1;i<=10;i=i+3) s+=i; ”后,變量 s 、 i 的當前值是
8:下列各語句中,能夠且僅輸出整型變量 a 、 b 中最大值的是
9:設 int a=9,b=20 ;則 printf( ″ %d,%d\n ″ ,a--,--b) ;的.輸出結果是
10:對于do-while語句,錯誤的說法是
11:初始化一維數(shù)組 a 正確的語句是
12:
- 執(zhí)行下列程序
- #define R 0.5
- #define AREAx R*x*x
- main
- {int a=1, b=2;
- printf ″%5。1f\n″, AREAa+b;
- }
- 后輸出的結果是
13:設 float c,f;, 將數(shù)學表達式 C= (F-32) 能正確表示成 C 語言賦值表達式的是
14:若數(shù)組名作實參而指針變量作形參,函數(shù)調用實參傳給形參的是
簡答題
15:以下兩條輸出語句分別輸出什么?
float a = 1.0f;
cout << (int)a << endl;
cout << (int&)a << endl;
cout << boolalpha << ( (int)a == (int&)a ) << endl; /pic/> Float b = 0.0f;
cout << (int)b << endl;
cout << (int&)b << endl;
cout << boolalpha << ( (int)b == (int&)b ) << endl; /pic/div>
float a = 1.0f;
cout << (int)a << endl;
cout << (int&)a << endl;
cout << boolalpha << ( (int)a == (int&)a ) << endl; /pic/> Float b = 0.0f;
cout << (int)b << endl;
cout << (int&)b << endl;
cout << boolalpha << ( (int)b == (int&)b ) << endl; /pic/div>
16:閱讀下列程序段,簡述其主要功能。
#include
void main()
{
FILE*fpd1, *fpd2;
char ch;
fpd1=fopen(“d1.dat”,“r”) ;
fpd2=fopen(“d2.dat”,“w”) ;
while(fscanf(fpd1,“%c”,&ch)!=EOF)
if (ch>='A'&& ch <='Z' ‖ ch>='a'&& ch<='z')
fprintf(fpd2,“%c”,ch);
fclose(fpd1);
fclose(fpd);
}
#include
void main()
{
FILE*fpd1, *fpd2;
char ch;
fpd1=fopen(“d1.dat”,“r”) ;
fpd2=fopen(“d2.dat”,“w”) ;
while(fscanf(fpd1,“%c”,&ch)!=EOF)
if (ch>='A'&& ch <='Z' ‖ ch>='a'&& ch<='z')
fprintf(fpd2,“%c”,ch);
fclose(fpd1);
fclose(fpd);
}
17:根據(jù)蒙特卡洛算法計算圓周率
double PI( DOWRD dwCount/*測試次數(shù)*/ );
返回值:PI
double PI( DOWRD dwCount/*測試次數(shù)*/ );
返回值:PI
18:簡述數(shù)組與指針的區(qū)別?
19:閱讀下列程序,簡述其主要功能。
# include
struct {
int hour, minute, second;
}time;
main ()
{
scanf (“%d:%d:%d” ,&time.hour, &time.minute, &time.second);
time.second++;
if (time.second ==60)
{
time.minute++
time.second=0;
if (time.minute==60)
{
time.hour++;
time.minute=0;
if (time.hour ==24) time.hour=0;
}
}
printf ( “ %d:%d:%d \ n ” , time.hour, time.minute, time.second);
}
# include
struct {
int hour, minute, second;
}time;
main ()
{
scanf (“%d:%d:%d” ,&time.hour, &time.minute, &time.second);
time.second++;
if (time.second ==60)
{
time.minute++
time.second=0;
if (time.minute==60)
{
time.hour++;
time.minute=0;
if (time.hour ==24) time.hour=0;
}
}
printf ( “ %d:%d:%d \ n ” , time.hour, time.minute, time.second);
}
20:用<<,>>,|,&實現(xiàn)一個WORD(2個字節(jié))的高低位交換!!
21:編寫子函數(shù):(1)用冒泡法將一個數(shù)組排成升序的函數(shù)---SUB1;(2)在升序數(shù)組中插入一個數(shù),并且保持該數(shù)組仍為升序數(shù)組的函數(shù)---SUB2。主函數(shù):①輸入任意10個正整數(shù)給數(shù)組;②調用SUB1對數(shù)組進行排序;③從鍵盤輸入一個正整數(shù),調用SUB2將其插入該數(shù)組。
22:請問以下代碼有什么問題:
int main()
{
char a;
char *str=&a;
strcpy(str,"hello");
printf(str);
return 0;
}
int main()
{
char a;
char *str=&a;
strcpy(str,"hello");
printf(str);
return 0;
}
23: Write a program that prints a list of all words in a document, and, for each word, a list of the line numbers on which it occurs. Remove noise words like "the", "and," and so on.
24:int func(int a)
{
int b;
switch(a)
{
case 1: 30;
case 2: 20;
case 3: 16;
default: 0
}
return b;
}
則func(1)=?
{
int b;
switch(a)
{
case 1: 30;
case 2: 20;
case 3: 16;
default: 0
}
return b;
}
則func(1)=?
25:字符指針、浮點數(shù)指針、以及函數(shù)指針這三種類型的.變量哪個占用的內存最大?為什么?
【托福聽力備考技巧「最新」】相關文章:
托福聽力備考高效技巧02-21
2016托福聽力高分備考技巧03-07
2016托福聽力考試備考技巧06-08
2016新托福聽力備考技巧03-28
2016托福聽力高效備考技巧04-28
2016托福聽力備考實用技巧02-09
托福聽力備考關鍵04-20
托福聽力滿分備考六大技巧03-28
托福聽力備考九大實用技巧04-05
- 相關推薦