标签:iostream mes names space for main basic bsp using
1 #include<iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 int n; 8 cin>>n; 9 10 if(n<10){ 11 for(int i=1;i<=n;i++) 12 cout<<i; 13 } 14 else if(n<100&&n>10){ 15 int i=n/10; 16 int j=n%10; 17 for(int k=0;k<i;k++) 18 cout<<"S"; 19 if(j!=0){ 20 for(int k=1;k<=j;k++) 21 cout<<k; 22 } 23 24 } 25 else{ 26 int i=n/100; 27 int j=(n/10)%10; 28 int k=n%10; 29 for(int m=0;m<i;m++) 30 cout<<"B"; 31 if(j!=0){ 32 for(int m=0;m<j;m++) 33 cout<<"S"; 34 } 35 if(k!=0){ 36 for(int m=1;m<=k;m++) 37 cout<<m; 38 } 39 } 40 41 return 0; 42 }
标签:iostream mes names space for main basic bsp using
原文地址:https://www.cnblogs.com/stray-yang/p/13358282.html