首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
lingdongyang
2024年3月15日 11:21
首字母大写 题解:
P1240
回复 0
|
赞 2
|
浏览 793
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char s[105]; while (gets(s) != NULL) { int len = strlen(s); if (s[0] >= 'a' && s[0] <= 'z') { s[0] = s[0] - 32; } for (int i = 0; i < len; i++) { if ((...
easymoney
2024年3月13日 12:32
首字母大写 题解:
P1240
回复 0
|
赞 0
|
浏览 618
#include <stdio.h> #include <string.h> int main() { char s[100]; gets(s); if (s[0] >= 'a' && s[0] <= 'z') s[0] += 'A' - 'a'; ...
FIVEszc
2024年3月11日 18:34
首字母大写 题解: C++
P1240
回复 0
|
赞 0
|
浏览 745
#include <bits/stdc++.h> using namespace std; int main() { char s[100]; int i; fgets(s,100,stdin); int len=strlen(s); if(s[0]>='a'&&s[0]<='z') s[0]=s[0]-32; for(i=0;i<len;i++) {if((s[i-1]==' '||s[i-1]=='\t'||s[i-1]=='\n'||s[...
2531404013
2024年3月8日 10:25
首字母大写 :为什么一直ac60 有没有佬帮我看一下
P1240
回复 3
|
赞 7
|
浏览 993
#include <cstdio> #include <iostream> using namespace std; int main() { string s; while(getline(cin,s)){ if(s[0]!=' '&&s[0]>='a'&&s[0]<='z') s...
Yw1111111
2024年3月6日 14:41
首字母大写 题解:Python
P1240
回复 0
|
赞 0
|
浏览 619
set = [' ','\n','\t','\r'] while True: try: all = input() result = "" for i in range(len(all)): if (all[i].isalpha() and all[i-1] in set) or i == 0: result += all[i].upper() els...
zhangan
2024年3月6日 11:35
首字母大写 题解:
P1240
回复 1
|
赞 1
|
浏览 907
//只有80%的正确率,有大佬帮忙看看吗 #include <stdio.h> #include <ctype.h> #include <string.h> void capitalize_words(char *str) { int i = 0; // 处理第一个字符 if (islower(str[0])) { str[0] = toupper(str[0]); &nbs...
williams
2024年3月6日 11:21
首字母大写 题解:
P1240
回复 0
|
赞 1
|
浏览 804
别忘考虑已经大写了的情况 #include <stdio.h> #include <stdbool.h> #include <math.h> #include <string.h> int main(void) { char s[100]; while(gets(s)!=NULL){ for(int i=0;i<strlen(s);i++){ if(i==0&&(s[i]>='a'&&s[i]<='z'))...
halo_777
2024年2月18日 20:16
首字母大写 题解:
P1240
回复 0
|
赞 0
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; char s[100]; int main() { while (gets(s)) { int len = strlen(s); if (s[0] <= 'z' && s[0] >= 'a') s[0] = s[0] - 'a' + 'A'; for (int i = 1; i < len; i++) { if (s[i-1] == ' '...
小王桐学
2024年1月27日 14:04
首字母大写 题解:
P1240
回复 0
|
赞 1
|
浏览 981
#include <stdio.h> #include <stdlib.h> #include <string.h> void Initial_B(char *s) { int i = 0,j; while(s[i] != '\0') { j = i; // while((s[j] >= 'a' && s[j] <= 'z') || (s[j] >= 'A' && s[j] <= 'Z')) while(s[j] != ' ' &a...
Cookie‘s AE86
2024年1月17日 10:53
首字母大写 题解:C++
P1240
回复 0
|
赞 1
|
浏览 982
#include<bits/stdc++.h> using namespace std; int main(){ char s[100]; int judge ; while( gets(s)){ judge = 1; int len = strlen(s) ; for(int i = 0 ;i < len ;i++){ if(judge == 1 && s[i] <= 'z' && s[i] >= '...
1
2
3
4
5
题目
首字母大写
题解数量
44
发布题解
在线答疑
热门题解
1
首字母大写 题解:注意这题目的要求 不是空格后面首字母要大写 是空白符!!!
2
首字母大写 题解:
3
布灵布灵
4
首字母大写 题解:非常好理解
5
首字母大写 题解:
6
首字母大写 题解:c++
7
首字母大写 题解:好奇怪,同样的数据,dev运行出来的结果就是对的,怎么复制过来就输出结果只有一个首字母不对唉。附上我得程序代码和截图。
8
首字母大写 题解:
9
首字母大写 题解:
10
P1240 首字母大写 答疑提问: