1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include <iostream> #include <cstdio> #include <cstring> #include <string> using namespace std; string a,t; int i,j; int main(){ a="morning"; j=1; for (int i = 2; i <=7; i++) if(a[j]<a[i]) j=i; j=j-1; for ( i = 0; i <=j ; i++) printf("%c",a[i]); return 0; } |
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:
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、该程序可以正常运行。 ( )
2、将第12行的a[j]<a[i]改成a[j]<=a[i],输出结果不变。( )
3、该程序的输出结果为。( )
4、该程序的时间复杂度级别为( )