解题思路:
注意事项:
参考代码:
#include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; for(int i=1; i<=a; i++) { string str; cin>>str; int n=str.size(); if(str[0]>=97) { cout<<char(str[0]-32); } else{ cout<<str[0]; } for(int i=1; i<n; i++) { if(str[i]<=90&&str[i]>=65) { cout<<char(str[i]+32); } else { cout<<str[i]; } } cout<<endl; } return 0; }
0.0分
1 人评分
剪刀石头布 (C语言代码)浏览:1747 |
C语言考试练习题_一元二次方程 (C语言代码)浏览:575 |
有关字符,字符串的输入输出函数说明浏览:478 |
链表数据求和操作 (C语言代码)浏览:941 |
C语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:585 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:354 |
字符串的修改 (C语言代码)浏览:1139 |
逆反的01串 (C语言代码)浏览:1436 |
简单的a+b (C语言代码)浏览:557 |
C语言程序设计教程(第三版)课后习题6.7 (C++代码)浏览:586 |