F.A.Qs Home ProblemSet Status Ranklist Contest LoginRegister
Notice:祝各位Oier新年快乐,Rp++!
大视野在线测评-欢迎您
[ New Thread ]
Problem 3214 >> 不是很懂你们说的\r和\n
liujiahui @ 2017-12-06 17:49:13
[ Quote ] [ Edit ] [ Delete ] 1#
c=gethchar();
while (c!='\n'){
if (c>='a'&&c<='z')k=k*27+c-'a'+1;
else a[++n]=k,k=0;
c=getchar();
}
这个【AC】了
____________________________________
c=0;
while (c!='\n'){
cin >> s;
for (int i=0;i<s.length();i++)k=k*27+s[i]-'a'+1;
else a[++n]=k,k=0;
c=getchar();
}
这个【Runtime_error】了
___________________________________
c=0;
while (c!='\n'&&c!='\r'){
cin >> s;
for (int i=0;i<s.length();i++)k=k*27+s[i]-'a'+1;
else a[++n]=k,k=0;
c=getchar();
}
这个【AC】了
___________________________________
不是很清楚cin>>s到底读进去什么了orz
skyline @ 2017-12-06 21:19:46
[ Quote ] [ Edit ] [ Delete ] 2#
第一行getchar好像打错了?
[Top] [Previous Page] [Next Page]

HOME Back