0 of 3 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 3 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)
1、看程序写结果: (2007年真题)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#include<iostream> using namespace std; int main(){ int i, p[5], a, b, c, x, y = 20; for ( i = 0; i <= 4; i++ )cin>>p[i]; a = (p[0] + p[1]) + (p[2] + p[3] + p[4]) / 7; b = p[0] + p[1] / ( (p[2] + p[3]) / p[4]); c = p[0] * p[1] / p[2]; x = a + b - p[(p[3] + 3) % 4]; if ( x > 10 ) y += (b * 100 - a) / (p[p[4] % 3] * 5); else y += 20 + (b * 100 - c) / (p[p[4] % 3] * 5); cout<<x<<','<<y; return(0); } |
输入:6 6 5 5 3 输出为 ,
2、阅读程序写结果: (2008年真题)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#include<iostream> using namespace std; int main(){ int i, a, b, c, d, f[4]; for(i = 0; i < 4; i++) cin >> f[i]; a = f[0] + f[1] + f[2] + f[3]; a = a / f[0]; b = f[0] + f[2] + f[3]; b = b / a; c = (b * f[1] + a) / f[2]; d = f[(b / c ) % 4]; if(f[(a + b + c + d) % 4] > f[2]) cout << a + b<< endl; else cout << c + d << endl; return 0; } |
输入:9 19 29 39 输出为:
3、阅读程序写出结果: (2013年提高组)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#include <iostream> using namespace std; const int SIZE = 100; int main() { int n, i, isPlalindrome; char str[SIZE]; cin>>str; n = strlen(str); isPlalindrome = 1; for (i = 0; i < n/2; i++) { if (str[i] != str[n-i-1]) isPlalindrome = 0; } if (isPlalindrome) cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; } |
输入:abceecba 输出: