注:此为c++代码
虽然我的代码无注释,但如想复制,必须完全搞懂代码所对应的题!
Dev c++这东西点进来的都有吧,详情见我的另一篇文章。
正式进入题解部分: (本人小白,大佬们请勿吐槽)
1129:
#include<bits/stdc++.h> using namespace std; char a[300]; int sum,len; int main() { gets(a); len=strlen(a); for(int i=0;i<=len-1;i++) { if(a[i]>=48&&a[i]<=57) { sum++; } } cout<<sum; return 0; }
讯享网
1130:
讯享网#include<bits/stdc++.h> using namespace std; char a[],b; int len,sum; int main() { gets(a); len=strlen(a); for(int i=0;i<=len-1;i++) { sum=0; b=a[i]; for(int j=0;j<=len-1;j++) { if(b==a[j]) { sum++; } } if(sum>=2) { } else if(sum==1) { cout<<b; return 0; } } cout<<"no"; return 0; }
1131:
#include<bits/stdc++.h> using namespace std; char a[501],b[501]; double len,sum,c; int main() { cin>>c>>a>>b; len=strlen(a); for(int i=0;i<=len-1;i++) { if(a[i]==b[i]) { sum++; } } if(sum/len>=c) { cout<<"yes"; } else { cout<<"no"; } return 0; }
1132:
讯享网#include<iostream> using namespace std; char a[101],b[101]; int n; int main() { cin>>n; for(int i=0;i<n;i++) { cin>>a>>b; if(a[0]=='R'&&b[0]=='S'||a[0]=='S'&&b[0]=='P'||a[0]=='P'&&b[0]=='R') { cout<<"Player1"<<endl; } else if(a[0]==b[0]) { cout<<"Tie"<<endl; } else { cout<<"Player2"<<endl; } } return 0; }
1133:
#include<bits/stdc++.h> using namespace std; char ch[101]; int len; int main() { gets(ch); len=strlen(ch); for(int i=0;i<=len-2;i++) { cout<<char(ch[i]+c
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/134292.html