举一反三
- 下列语句中,正确的是( ). A: char myString[ ]="Hello-World!"; B: char myString="Hello-World!"; C: char myString[11]="Hello-World!"; D: char myString[12]="Hello-World!";
- 下列语句中,正确的是( )。 A: char*myString="Hello-World!"; B: char myString="Hello-World!"; C: char myString[11]="Hello-World!"; D: char myString[12]="Hello-World!";
- (7-3)编译如下定义的MyString类,将出现()。class MyString extends java.lang.String{ }
- 中国大学MOOC: 下面程序执行后的输出结果是:#include <iostream>using namespace std;void ss(char *s,char t){while(*s) {if(*s==t) *s=t-a+A;s++;}}int main(){char str1[100]="abcddfefdbd",c=d;ss(str1,c); cout<<str1;return 0;}
- 下列语句中,正确的是()。 A: char*myString=“Hello-World!”; B: charmyString=“Hello-World!”; C: charmyString[11]=“Hello-World!”; D: charmyString[12]=“Hello-World!”;
内容
- 0
DateTime.Parse(myString);这行代码有什么问题?
- 1
中国大学MOOC:"如下程序的输出是什么____#include #include using namespace std;struct MyException : public exception{ const char * what () const throw () { return "C++ Exception"; }};int main(){ try { throw MyException(); } catch(MyException& e) { std::cout << "MyException" << std::endl; } catch(std::exception& e) { std::cout<<"exception" << std::endl; }}";
- 2
对于如下程序:#include [stdio.h] int s(char *,char *); int main(){ char a[20]; char b[10]; char *p; char *q; int i; p=a; q=b; scanf("%s%s",a,b); i=s(a,b); printf("%d",i);} int s(char *s,char *t){ while(*s!='\0' && *t!='\0'){ if(*s= =*t){ s++; t++; } else return *s-*t; } return *s-*t;}如果输入流是12 13,程序的输出是什么? A: -1 B: 1 C: 0 D: 2
- 3
中国大学MOOC: 下列程序的运行结果是 。 #include<iostream>using namespace std;char *fun(char *str, char c){ while ( *str!=’\0’) if(*str==c) return (str); else str++; return (NULL);}void main(){ char s [80] = “warrior”, *p; p=fun(s, ‘r’); if(p) cout<<p<<endl;p=fun(s, ‘i’); if(p) cout<<p<<endl;p=fun(s, ‘b’); if(p) cout<<p<<endl;}
- 4
以下C的程序片段输出的结果是( )。char p[20]; char *s = "Data"; int length = strlen(s); int i; for (i = 0; i < length; i++) p[i] = s[length - i]; printf("%s", p);[/i] A: 输出是空白 B: data C: atad D: adat