52 条题解
-
92
这题就是无脑狂写if语句 突然发现Ctrl+CV 是真香😄
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n >= 10000 and n < 99999) { cout << "wan" << endl; } if(n >= 100000 and n < 999999) { cout << "shi wan" << endl; } if(n >= 1000000 and n < 9999999) { cout << "bai wan" << endl; } if(n >= 10000000 and n < 99999999) { cout << "qian wan" << endl; } if(n >= 100000000 and n < 999999999) { cout << "yi" << endl; } if(n >= 1000000000 and n < 9999999999) { cout << "shi yi" << endl; } return 0; }
编码不易😕,点赞走起👀️
记得点赞再抱走奥😄 -
29
各位观众姥爷们,来吧,我先讲讲题目,可以用string型字符串数组,然后用a.size()来判断几位数,然后用几个分支语句即可。比陈元杰简单,看看吧~
#include <bits/stdc++.h> using namespace std; int main() { string a; getline(cin, a); if (a.size() == 5) cout << "wan"; else if (a.size() == 6) cout << "shi wan"; else if (a.size() == 7) cout << "bai wan"; else if (a.size() == 8) cout << "qian wan"; else if (a.size() == 9) cout << "yi"; else cout << "shi yi"; return 0; }
最后,点个赞吧~~~~写个评论吧
-
7
由于我学过的知识有限,只想出了这种
死算方法。 如果要用这种方法,建议你们使用复制粘贴。:command C + command V , Windows:ctrl C + ctrl V#include <iostream> using namespace std; int main() { int n; cin >> n; if (n < 100000) { cout << "wan" << endl; } else if (n < 1000000) { cout << "shi wan" << endl; } else if (n < 10000000) { cout << "bai wan" << endl; } else if (n < 100000000) { cout << "qian wan" << endl; } else if (n < 1000000000) { cout << "yi" << endl; } else { cout << "shi yi" << endl; } return 0; }
如果你们喜欢,可以点赞然后复制哟丶(^u^)—👍
-
3
见识一下粗暴代码(非抄袭)
#include<iostream> using namespace std; int main() { int a; cin>>a; if(a/10000<=9) { cout<<"wan"; } else if(a/100000<=9) { cout<<"shi wan"; } else if(a/1000000<=9) { cout<<"bai wan"; } else if(a/10000000<=9) { cout<<"qian wan"; } else if(a/100000000<=9) { cout<<"yi"; } else if(a/1000000000<=9) { cout<<"shi yi"; } return 0; }
这个代码比较适合初学者。 制作不易,求点赞👍
-
3
#include <iostream> using namespace std; int main() { int n; cin >> n; if(n / 100000 > 0) { if(n / 1000000 > 0) { if(n / 10000000 > 0) { if(n / 100000000 > 0) { if(n / 1000000000 > 0) { cout << "shi yi"; } else { cout << "yi"; } } else { cout <<"qian wan"; } } else { cout << "bai wan"; } } else { cout << "shi wan"; } } else { cout << "wan"; } return 0; }
-
2
easy
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; if(n>=10000&&n<100000){ cout<<"wan"; }else if(n>=100000&&n<1000000){ cout<<"shi wan"; }else if(n>=1000000&&n<10000000){ cout<<"bai wan"; }else if(n>=10000000&&n<100000000){ cout<<"qian wan"; }else if(n>=100000000&&n<1000000000){ cout<<"yi"; }else{ cout<<"shi yi"; } return 0; }
-
2
#include<iostream> using namespace std; int main() { long long n,num=0; cin>>n; for(int i=1;i<=10;i++) { if(n/10>=1) { n=n/10; num++; } else { break; } } for(int i=1;i<=1;i++) { if(num>=9) { cout<<"shi yi"; break; } if(num>=8) { cout<<"yi"; break; } if(num>=7) { cout<<"qian wan"; break; } if(num>=6) { cout<<"bai wan"; break; } if(num>=5) { cout<<"shi wan"; break; } if(num>=4) { cout<<"wan"; break; } } return 0; }
-
2
暴力判断即可
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n >= 10000 and n <= 99999) { cout << "wan"; } if (n >= 100000 and n <= 999999) { 1cout << "shi wan"; } if (n >= 1000000 and n <= 9999999) { cout << "bai wan"; } if (n >= 10000000 and n <= 99999999) { cout << "qian wan"; } if (n >= 100000000 and n <= 999999999) { cout << "yi"; } if (n >= 1000000000 and n <= 9999999999) { cout << "shi yi"; } return 0; }
-
2
数学题
#include <iostream> using namespace std; int main() { int n; cin>>n; if (n/1000000000!=0) { cout<<"shi yi"; } else if(n/100000000!=0) { cout<<"yi"; } else if(n/10000000!=0) { cout<<"qian wan"; } else if(n/1000000!=0) { cout<<"bai wan"; } else if(n/100000!=0) { cout<<"shi wan"; } else { cout<<"wan"; } }
-
2
简单,就是if else if else 语句 #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n/10000<10) { cout << "wan"; } else if(n/10000<100) { cout << "shi wan"; } else if(n/10000<1000) { cout << "bai wan"; } else if(n/10000<10000) { cout << "qian wan"; } else if(n/10000<100000) { cout << "yi"; } else { cout << "shi yi"; }
return 0; }
-
2
大概看了其他题解,发现我的好像有点不一样( 用的是数位切分(应该是这么叫吧 反正能过 ~~(先赞后看好习惯~
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n / 1000000000 >= 1) { cout << "shi yi"; } else if (n / 100000000 >= 1) { cout << "yi"; } else if (n / 10000000 >= 1) { cout << "qian wan"; } else if (n / 1000000 >= 1) { cout << "bai wan"; } else if (n / 100000 >= 1) { cout << "shi wan"; } else if (n / 10000 >= 1) { cout << "wan"; } return 0; }
-
2
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n >= 10000 and n < 99999) { cout << "wan" << endl; } if(n >= 100000 and n < 999999) { cout << "shi wan" << endl; } if(n >= 1000000 and n < 9999999) { cout << "bai wan" << endl; } if(n >= 10000000 and n < 99999999) { cout << "qian wan" << endl; } if(n >= 100000000 and n < 999999999) { cout << "yi" << endl; } if(n >= 1000000000 and n < 9999999999) { cout << "shi yi" << endl; } return 0; } 求点赞!!!
-
2
if?if是不可呢写的,这题没必要
#include <iostream> using namespace std; string out[15] = { "草","ge","shi","bai","qian", "wan","shi wan","bai wan","qian wan", "yi","shi yi","bai yi" , "qian yi","草"}; //分行美观,数组存每位输出什么 long long n , i = 1;//我管他int会不会出事,看着大直接long long int m ;//几位数 int main(){ cin >> n ;//n>=10000 所以0啥的不用单独处理 while(i < n) i *= 10 , m ++;//i >= n自动跳出,这时m就是数的位数 cout << out[m] ;//输出 return 0 ;//你就说写的少不少吧 }
#include <iostream> using namespace std; string out[15] = { "草","ge","shi","bai","qian", "wan","shi wan","bai wan","qian wan", "yi","shi yi","bai yi" , "qian yi","草"};//同上 int main(){ cin >> out[0] ;//0位置输入,不用再开一个string cout << out[out[0].length()] ;//string长度=位数 //.length(),.size()都能获取长度,本质区别不大 return 0;//行数少了,但还是3ms,不行啊 }
点赞再抱走奥
-
1
#include <iostream> using namespace std; int main() { long long a,num=0; cin>>a; while(a>0) { num++; a/=10; } if(num==5) { cout<<"wan"; } if(num==6) { cout<<"shi wan"; } if(num==7) { cout<<"bai wan"; } if(num==8) { cout<<"qian wan"; } if(num==9) { cout<<"yi"; } if(num==10) { cout<<"shi yi"; } return 0; }
-
1
Ctrl+c/v用起来!!!(@陈元杰 都是复制if)
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if(n >= 10000 and n < 99999) { cout << "wan" << endl; } if(n >= 100000 and n < 999999) { cout << "shi wan" << endl; } if(n >= 1000000 and n < 9999999) { cout << "bai wan" << endl; } if(n >= 10000000 and n < 99999999) { cout << "qian wan" << endl; } if(n >= 100000000 and n < 999999999) { cout << "yi" << endl; } if(n >= 1000000000 and n < 9999999999) { cout << "shi yi" << endl; } return 0; }
-
1
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n >= 10000 and n < 99999) { cout << "wan" << endl; } if(n >= 100000 and n < 999999) { cout << "shi wan" << endl; } if(n >= 1000000 and n < 9999999) { cout << "bai wan" << endl; } if(n >= 10000000 and n < 99999999) { cout << "qian wan" << endl; } if(n >= 100000000 and n < 999999999) { cout << "yi" << endl; } if(n >= 1000000000 and n < 9999999999) { cout << "shi yi" << endl; } return 0; }
-
1
#include <iostream> using namespace std; int main() { int n; cin >> n;//这个不要漏 if (n < 100000)//if语句判断,以此类推 { cout << "wan" << endl;//通过判断,进行输出 } else if (n < 1000000) { cout << "shi wan" << endl; } else if (n < 10000000) { cout << "bai wan" << endl; } else if (n < 100000000) { cout << "qian wan" << endl; } else if (n < 1000000000) { cout << "yi" << endl; } else { cout << "shi yi" << endl; } return 0; }//
-
1
#include <iostream> using namespace std; int main() { int x; cin >>x; if (x<10) { cout <<"ge"; } if (x>=10) { if (x<=99) { cout <<"shi"; } } if (x>=100) { if (x<=999) { cout <<"bai"; } } if (x>=1000) { if (x<=9999) { cout <<"qian"; } } if (x>=10000) { if (x<=99999) { cout <<"wan"; } } if (x>=100000) { if (x<=999999) { cout <<"shi wan"; } } if (x>=1000000) { if (x<=9999999) { cout <<"bai wan"; } } if (x>=10000000) { if (x<=99999999) { cout <<"qian wan"; } } if (x>=100000000) { if (x<=999999999) { cout <<"yi"; } } if (x>=1000000000) { if (x<=9999999999) { cout <<"shi yi"; } } if (x>=10000000000) { if (x<=99999999999) { cout <<"bai yi"; } } if (x>=100000000000) { if (x<=999999999999) { cout <<"qian yi"; } } if (x>=1000000000000) { if (x<=9999999999999) { cout <<"zhao"; } } return 0; }
以AC,可以放心食用
-
1
#include <iostream> using namespace std; int main() { int x; cin >>x; if (x<10) { cout <<"ge"; } if (x>=10) { if (x<=99) { cout <<"shi"; } } if (x>=100) { if (x<=999) { cout <<"bai"; } } if (x>=1000) { if (x<=9999) { cout <<"qian"; } } if (x>=10000) { if (x<=99999) { cout <<"wan"; } } if (x>=100000) { if (x<=999999) { cout <<"shi wan"; } } if (x>=1000000) { if (x<=9999999) { cout <<"bai wan"; } } if (x>=10000000) { if (x<=99999999) { cout <<"qian wan"; } } if (x>=100000000) { if (x<=999999999) { cout <<"yi"; } } if (x>=1000000000) { if (x<=9999999999) { cout <<"shi yi"; } } if (x>=10000000000) { if (x<=99999999999) { cout <<"bai yi"; } } if (x>=100000000000) { if (x<=999999999999) { cout <<"qian yi"; } } if (x>=1000000000000) { if (x<=9999999999999) { cout <<"zhao"; } } return 0; }
以AC,可以放心食用^^ ** _
-
1
这题就是无脑狂写if语句 突然发现Ctrl+CV 是真香😄
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n >= 10000 and n < 99999) { cout << "wan" << endl; } if(n >= 100000 and n < 999999) { cout << "shi wan" << endl; } if(n >= 1000000 and n < 9999999) { cout << "bai wan" << endl; } if(n >= 10000000 and n < 99999999) { cout << "qian wan" << endl; } if(n >= 100000000 and n < 999999999) { cout << "yi" << endl; } if(n >= 1000000000 and n < 9999999999) { cout << "shi yi" << endl; } return 0; }
编码不易😕,点赞走起👀️ 记得点赞再抱走奥😄
信息
- ID
- 319
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 3
- 标签
- 递交数
- 4873
- 已通过
- 2630
- 上传者