think:
1常量数组运用
2getchar()和purchar()运用
3for循环结束的限制条件
以下为accepted代码
#include <bits/stdc++.h>
using namespace std;
int main()
{
char st[] = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
int i, c;
while((c = getchar()) != EOF)
{
for(i = 0; st[i] && st[i] != c; i++);
if(st[i])
putchar(st[i-1]);
else
putchar(c);
}
return 0;
}
本文探讨了C++中常量数组的使用,包括其在程序中的实际操作,并详细介绍了getchar()和purge()函数的运用场景。同时,通过一个具体的for循环实例,阐述了循环结束条件的设定方法。文章还提供了相关vjudge题目链接,供读者实践。
7066

被折叠的 条评论
为什么被折叠?



