首页
比赛
题库
课程
竞赛讨论区
登录
/
注册
去牛客
首页
>
复制输出
10条解析
开通博客写题解
Ayx03
发表于 2022-03-19 17:31:25
字符串长度并未给出,因此不考虑使用 char 数组和 gets(),更何况后者在 C++11 中已经被移除。 #include<bits/stdc++.h> using namespace std; int main(){ char s=getchar(); while(
展开全文
霸气灬钦哥
发表于 2020-07-25 10:10:09
#include<iostream> #include<cstring> using namespace std; int main() { string s; getline(cin,s); cout<<s<<endl; }分
展开全文
吴桐宇
发表于 2023-01-31 13:32:00
今天我们来挑战python一行题解!!!! print(input()) 撒花~结束 是不是很简单!!
潍坊鲨鱼公园儿童大学
发表于 2021-01-26 16:38:48
#include <iostream> #include <string> using namespace std; int main() { string str; getline(cin, str); cout << str;
展开全文
我儿雷俊有大帝之资
发表于 2024-11-10 15:02:16
#include <stdio.h> int main(){ char c; while((c=getchar())!='\n'){ printf ("%c",c);} ret
展开全文
牛客517072235号
发表于 2021-08-01 19:24:54
#include<iostream> #include<string> using namespace std; int main() { string a; getline(cin,a); cout<<a; return 0; }
展开全文
阿八阿八
发表于 2022-02-27 15:20:50
#include<stdio.h> #include<string.h> int main() { int i,j; char str[1000]; &nb
展开全文
Tender^
发表于 2021-10-02 23:58:13
#include<bits/stdc++.h> using namespace std; int main(){ char a; a=getchar(); while(a!='\n'){ cout<<a; a=getch
展开全文
23数二杨帆
发表于 2023-11-02 11:15:39
#include <bits/stdc++.h> using namespace std; int main() { string str; getline(cin , str); cout << str; return 0; }
祁皓轩
发表于 2022-01-15 21:52:40
这题只需使用getline函数和cout语句以及对字符串的定义即可AC #include<bits/stdc++.h> using namespace std; int main() { string 
展开全文
查看本题
查看本题讨论
相关比赛
18143-阿尔法NOIP集训营-Day1
进入比赛
18160-阿尔法-C++CSP训练(2星)
进入比赛
18388-暑假第一周Java基础训练
进入比赛
19467-阿尔法C++暑期日常训练
进入比赛
20957-实验室纳新内推热身赛
进入比赛
等你来战
查看全部
牛客练习赛139
报名截止时间:2025-05-23 21:30
牛客周赛 Round 94
报名截止时间:2025-05-25 21:00
牛客2025年儿童节比赛
报名截止时间:2025-06-01 21:00
衡阳师范学院第二十五届程序设计竞赛(同步赛)
报名截止时间:2025-06-08 18:00
2025牛客暑期多校训练营1
报名截止时间:2025-07-15 17:00
扫描二维码,关注牛客
意见反馈
下载牛客APP,随时随地刷题