0 of 4 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 4 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
23、阅读程序写结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <iostream> using namespace std; int main(){ int a,b,c; a = 1; b = 2; c = 3; if (a>b){ if (a>c) cout << a <<' '; else cout << b << ' '; } cout << c << endl; return 0; } |
输出为
24、阅读程序写结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#include <iostream> using namespace std; struct point{ int x; int y; }; int main() { struct EX{ int a; int b; point c; }e; e.a = 1; e.b = 2; e.c.x = e.a + e.b; e.c.y = e.a * e.b; cout << e.c.x << ',' << e.c.y << endl; return 0; } |
输出为
25、阅读程序写结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <iostream> #include <string> using namespace std; int main() { string str; int i; int count; count = 0; getline( cin, str ); for ( i = 0; i < str.length(); i++ ) if ( str[i] >= 'a' && str[i] <= 'z' ) count++; cout << "It has " << count << " lowercases" << endl; return(0); |
输入:NOI2016 will be held in Mian Yang.
输出:
26、阅读程序写结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#include <iostream> #include <string> using namespace std; void fun( char *a, char *b ) { a = b; (*a)++; } int main() { char c1, c2, *p1, *p2; c1 = 'A'; c2 = 'a'; p1 = &c1; p2 = &c2; fun( p1, p2 ); cout << c1 << c2 << endl; return(0); } |
输出为: