【hiho一下_week259】风格不统一如何写程序
作者:互联网
传送门:https://hihocoder.com/contest/hiho259/problems
这周题目太简单,直接放代码,不解释。
#include <iostream>
int main(int argc, char** argv) {
int n;
char ch;
scanf("%d", &n);
getchar();
while (n) {
scanf("%c", &ch);
if (ch == '\n') {
n--;
printf("\n");
}
else if (ch >= 'A' && ch <= 'Z') {
printf("_");
printf("%c", ch-'A'+'a');
}
else if (ch == '_') {
scanf("%c", &ch);
printf("%c", ch-'a'+'A');
}
else {
printf("%c", ch);
}
}
return 0;
}
标签:ch,int,scanf,程序,char,传送门,week259,hiho 来源: https://blog.csdn.net/ZhangDanzhu/article/details/93104817