320) 若要利用if-else语句判断year是否闰年,是闰年则返回1,不是闰年则返回0。 以下选项中不能完成正确判断的程序段是 A: if(year%400==0)<br/>return 1; else if(year%100!=0) if(year%4==0) return 1; else return 0; B: if(year%400!=0)<br/>if(year%100==0) return 0; else if(year%4==0) return 1; else return 0;<br/>else return 1; C: if(year%100==0)<br/>if(year%400==0) return 1; else return 0; else if(year%4==0) return 1;<br/>else return 0; D: if(year%4!=0)<br/>return 0; else if(year%400==0) return 1; else if(year%100==0) return<br/>0; else return 1;
320) 若要利用if-else语句判断year是否闰年,是闰年则返回1,不是闰年则返回0。 以下选项中不能完成正确判断的程序段是 A: if(year%400==0)<br/>return 1; else if(year%100!=0) if(year%4==0) return 1; else return 0; B: if(year%400!=0)<br/>if(year%100==0) return 0; else if(year%4==0) return 1; else return 0;<br/>else return 1; C: if(year%100==0)<br/>if(year%400==0) return 1; else return 0; else if(year%4==0) return 1;<br/>else return 0; D: if(year%4!=0)<br/>return 0; else if(year%400==0) return 1; else if(year%100==0) return<br/>0; else return 1;
以下程序的输出结果是()。#includestdio.hintf(intx){inty;if(x==0||x==1)return(3);y=x*x-f(x-2);returny;}intmain(){intz;z=f(3);printf(%d ,z);return0;}
以下程序的输出结果是()。#includestdio.hintf(intx){inty;if(x==0||x==1)return(3);y=x*x-f(x-2);returny;}intmain(){intz;z=f(3);printf(%d ,z);return0;}
下面正确的函数重载是________。 A: int F1(float f1) { return 0; } float F1(float f1) { return 0; } B: int F1(int i1) { return 0; } float F1(int i1 = 5) { return 0; } C: int F1(const float *p1) { return 0; } float F1(float const *const p1) { return 0; } D: int F1(int p1) { return 0; } int F1(int *p1) { return 0; }
下面正确的函数重载是________。 A: int F1(float f1) { return 0; } float F1(float f1) { return 0; } B: int F1(int i1) { return 0; } float F1(int i1 = 5) { return 0; } C: int F1(const float *p1) { return 0; } float F1(float const *const p1) { return 0; } D: int F1(int p1) { return 0; } int F1(int *p1) { return 0; }
如果要实现计算x绝对值的功能,下面程序有错误的是? A: int fun(int x){ if(x<0) return -x;<br> return x; } B: int fun(int x){ if(x<0) return -x;<br> else return x; } C: int fun(int x){ if(x<0) return -x;<br> if(x>0) return x; } D: int fun(int x){ if(x<0) return -x;<br> else if(x==0) return x; else return x; }
如果要实现计算x绝对值的功能,下面程序有错误的是? A: int fun(int x){ if(x<0) return -x;<br> return x; } B: int fun(int x){ if(x<0) return -x;<br> else return x; } C: int fun(int x){ if(x<0) return -x;<br> if(x>0) return x; } D: int fun(int x){ if(x<0) return -x;<br> else if(x==0) return x; else return x; }
Given: Which five methods, inserted independently at line 5, will compile?() A: protected int blipvert(long x) { return 0; } B: protected long blipvert(int x) { return 0; } C: private int blipvert(long x) { return 0; } D: private int blipvert(int x) { return 0; } E: public int blipvert(int x) { return 0; } F: protected long blipvert(long x) { return 0; } G: protected long blipvert(int x, int y) { return 0; }
Given: Which five methods, inserted independently at line 5, will compile?() A: protected int blipvert(long x) { return 0; } B: protected long blipvert(int x) { return 0; } C: private int blipvert(long x) { return 0; } D: private int blipvert(int x) { return 0; } E: public int blipvert(int x) { return 0; } F: protected long blipvert(long x) { return 0; } G: protected long blipvert(int x, int y) { return 0; }
中国大学MOOC:以下程序的输出结果是#includeintFunc();inti=10;intmain(){intj=1;j=Func();printf("%d,",j);j=Func();printf("%d",j);return0;}intFunc(){intk=0;k=k+i;i=i+10;return(k);}
中国大学MOOC:以下程序的输出结果是#includeintFunc();inti=10;intmain(){intj=1;j=Func();printf("%d,",j);j=Func();printf("%d",j);return0;}intFunc(){intk=0;k=k+i;i=i+10;return(k);}
Given: Which five methods, inserted independently at line 5, will compile?() A: public int blipvert(int x) { return 0; } B: private int blipvert(int x) { return 0; } C: private int blipvert(long x) { return 0; } D: protected long blipvert(int x) { return 0; } E: protected int blipvert(long x) { return 0; } F: protected long blipvert(long x) { return 0; }
Given: Which five methods, inserted independently at line 5, will compile?() A: public int blipvert(int x) { return 0; } B: private int blipvert(int x) { return 0; } C: private int blipvert(long x) { return 0; } D: protected long blipvert(int x) { return 0; } E: protected int blipvert(long x) { return 0; } F: protected long blipvert(long x) { return 0; }
Which five methods,inserted independently at line 5,will compile?() A: public int blipvert(int x){return 0;} B: private int blipvert(int x){return 0;} C: private int blipvert(long x){return 0;} D: protected int blipvert(long x){return 0;} E: protected long blipvert(long x){return 0;} F: protected long blipvert(int x, int y){return 0;}
Which five methods,inserted independently at line 5,will compile?() A: public int blipvert(int x){return 0;} B: private int blipvert(int x){return 0;} C: private int blipvert(long x){return 0;} D: protected int blipvert(long x){return 0;} E: protected long blipvert(long x){return 0;} F: protected long blipvert(int x, int y){return 0;}
以下哪一个是正确的C语言程序结构? A: B: include int main() { return 0; } C: int main() D: include { return 0; } E: int main() { F: include return 0; } G: H: include int main() { } return 0;
以下哪一个是正确的C语言程序结构? A: B: include int main() { return 0; } C: int main() D: include { return 0; } E: int main() { F: include return 0; } G: H: include int main() { } return 0;
下面程序执行后的输出结果是()。#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;} A: 10 B: 13 C: 21 D: 死循环
下面程序执行后的输出结果是()。#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;} A: 10 B: 13 C: 21 D: 死循环