XiangRui_FuZi! 题解分享 · 2025/3/1
拓拓在打字 - 题解
```C++ #include<bits/stdc++.h> using namespace std; int main(){ string s=" "; getline(cin,s); for(int i=0;i<s.size();i++){ if(s[i]==' '&&s[i+1]==' ') continue; cout<<s[i]; } return 0; } ```
0 0 1 17
re_uzume 题解分享 · 2024/4/7
拓拓在打字 - 题解
``` #include <stdio.h> #include <iostream> #include <string> using namespace std; int main(){ string str; while(cin>>str){ cout<<str<<' '; } } ```
0 0 2 21
zbz 题解分享 · 2024/4/7
拓拓在打字 - 题解
只要不是连续空格就输出 ``` #include<bits/stdc++.h> using namespace std; typedef long long LL; int main() { string str; getline(cin,str); for(int i=0;i<str.length();i++) { if(!(str[i]==' '&&str[i+1]==' ')) cout<<str[i]; } return 0; } ```
查看全文
0 0 1 9
橘子汽水7dnrj 题解分享 · 2025/4/6
拓拓在打字 - 题解
include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s; string c; getline(cin,s); for(int i=0;i 0&&i<=s.length()-2) { if(s[i] ==' '&&s[i+1]==' ') { continue; } else c.push_back(s[i]); } } cout<<c<<"\n"; return 0; }
查看全文
0 0 0 9
诗酒趁年华baltm 题解分享 · 2025/3/25
拓拓在打字 - 题解
include include using namespace std; int main() { string str; while (cin >> str) { cout << str << ' '; } //直接输入字符串,然后打印每一个字符串,且后面跟一个空格 return 0; }
0 0 0 7
MChaha165 题解分享 · 2024/10/12
拓拓在打字 - 题解
include using namespace std; int main() { string n; string a[12]; int i=0; while(cin>>n) { a[i]=n; i+=2; } for(int i=0;i<12;i++) { if(i%2==0) { cout<<a[i]; } else cout<<" "; } ``` return 0; ``` } // 0 1 2 3 4 5 6 7 8 9 10 11
查看全文
0 0 0 7
栀子花 题解分享 · 2024/7/8
拓拓在打字 - 题解
``` #include <iostream> #include<stdio.h> #include <vector> #include <string> using namespace std; int main() { string str; while (cin >> str) cout << str << ' '; return 0; } ```
0 0 0 7
栀子花 题解分享 · 2024/7/8
拓拓在打字 - 题解
``` #include <iostream> #include<stdio.h> #include <vector> #include <string> using namespace std; int main() { string str; getline(cin, str); int n = str.size(); for (int i = 0; i < n; i++) { if (str[i] != ' ' || (str[i] == ' ' && str[i + 1] != ' ')) cout << str[i]; } return 0; } ```
查看全文
0 0 0 7
HZZXhanzhi晗-智 题解分享 · 2024/4/5
拓拓在打字 - 题解
``` #include <bits/stdc++.h> using namespace std; int main() { string s; getline(cin,s); for(int i = 0;i < s.size();i++) { if((s[i] != ' ')||(s[i] == ' '&& s[i+1] != ' ')) cout << s[i]; } return 0; } ```
查看全文
0 0 0 9
47audience 题解分享 · 2024/4/7
拓拓在打字 - 题解
include using namespace std; int main(){ int n=0; string s; getline(cin,s); n=s.size(); for(int i=0;i<n;i++){ if(s[i]==' '&&s[i+1]==' ') ; else cout <<s[i]; } return 0; }
0 0 0 8