博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Hello World社团冬季招新暨杭电Umis项目人才招募程序设计竞赛
阅读量:2037 次
发布时间:2019-04-28

本文共 8029 字,大约阅读时间需要 26 分钟。

这是一道简单的签到题

/**@Author:   STZG*@Language: C++*/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define DEBUG#define RI register intusing namespace std;typedef long long ll;//typedef __int128 lll;const int N=100000+10;const int MOD=1e9+7;const double PI = acos(-1.0);const double EXP = 1E-8;const int INF = 0x3f3f3f3f;int t,n,m,k,q,ans;int a[N];char str;int main(){#ifdef DEBUG freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout);#endif while(~scanf("%d",&n)){ t=0; for(int i=1;i<=n;i++){ cin>>a[i]; t+=a[i]; } cout << t << endl; } //cout << "Hello world!" << endl; return 0;}

这是一道简单的判断题

/**@Author:   STZG*@Language: C++*/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define DEBUG#define RI register intusing namespace std;typedef long long ll;//typedef __int128 lll;const int N=100000+10;const int MOD=1e9+7;const double PI = acos(-1.0);const double EXP = 1E-8;const int INF = 0x3f3f3f3f;int t,n,m,k,q,ans;int a[N];char str;int main(){#ifdef DEBUG freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout);#endif while(~scanf("%d+%d=%d",&n,&m,&k)){ if(n==1&m==1&&k==3) cout << "YES" << endl; else cout << "NO" << endl; } //cout << "Hello world!" << endl; return 0;}

这是一道简单的递推题

/**@Author:   STZG*@Language: C++*/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define DEBUG#define RI register intusing namespace std;typedef long long ll;//typedef __int128 lll;const int N=100000+10;const int MOD=1e9+7;const double PI = acos(-1.0);const double EXP = 1E-8;const int INF = 0x3f3f3f3f;int t,n,m,k,q,ans;ll a[N];char str;int main(){#ifdef DEBUG freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout);#endif a[1]=1; a[2]=1; a[3]=1; for(int i=4;i<=70;i++){ a[i]=a[i-1]+a[i-2]+a[i-3]; } while(~scanf("%d",&n)){ cout << a[n] << endl; } //cout << "Hello world!" << endl; return 0;}

这是一道简单的数学题

/**@Author:   STZG*@Language: C++*/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define DEBUGusing namespace std;typedef long long ll;const int N=20000000;const double PI = acos(-1.0);const double EXP = 1E-8;const int INF = 0x3f3f3f3f;ll t,n,m;ll nine[300];ll total_nine;void init(){ nine[0] = 9; total_nine = 1; for(int i = 1; nine[i-1]*9ll<1e18; i ++) { nine[i] = nine[i-1]*9; total_nine ++; }}ll get_suff_count(ll m){ ll ret = 0; for(int i = 0; i < total_nine; i ++){ ret += m/nine[i]; } return ret;}int main(){#ifdef DEBUG freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout);#endif init(); while(~scanf("%lld",&n)){ cout << get_suff_count(n*n*n) << endl; } //cout << "Hello world!" << endl; return 0;}
#include
int main(){ long long int n; while(scanf("%lld",&n)!=EOF) { n=n*n*n; long long int sum=0; while(n!=0) { n=n/9; sum+=n; } printf("%lld\n",sum); } return 0;}

这是一道简单的字符题

/**@Author:   STZG*@Language: C++*/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define DEBUG#define RI register intusing namespace std;typedef long long ll;//typedef __int128 lll;const int N=100000+10;const int MOD=1e9+7;const double PI = acos(-1.0);const double EXP = 1E-8;const int INF = 0x3f3f3f3f;int t,n,m,k,q,ans;int a;char str[100];string s;int main(){#ifdef DEBUG freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout);#endif while(~scanf("%d",&n)){ ans=1000; string a="i love you",b="i hate you"; getchar(); for(int i=1;i<=n;i++){ getline(cin,s); if(s==a) ans+=100; if(s==b) ans-=500; } if(ans>=0){ cout << "good man!" << endl; }else{ cout << "xiaoming=zhanan" << endl; } } //cout << "Hello world!" << endl; return 0;}

这是一道简单的计算题

#include
using namespace std; int n,T; int x[4],y[4],A,B,C,M,W; vector
v; bool cmp(const int &a,const int &b) { return a>b; } int main() { scanf("%d",&T); while(T--) { scanf("%d%d%d",&x[1],&y[1],&A); scanf("%d%d",&x[2],&B); scanf("%d%d%d",&x[3],&y[3],&C); scanf("%d%d",&M,&W); int ans=0; for(int i=0;i<=A;i++) { for(int j=0;j<=C;j++) { v.clear(); for(int k=1;k<=i;k++) v.push_back(x[1]); for(int k=1;k<=j;k++) v.push_back(x[3]); sort(v.begin(),v.end(),cmp); int tmp=0; for(int k=0;k
=M) puts("Win"); else printf("%d\n",M-ans); } return 0; }

这是一道简单的游戏题

/**@Author:   STZG*@Language: C++*/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define DEBUG#define RI register intusing namespace std;typedef long long ll;//typedef __int128 lll;const int N=100000+10;const int MOD=1e9+7;const double PI = acos(-1.0);const double EXP = 1E-8;const int INF = 0x3f3f3f3f;int t,n,m,k,q,ans;int a;char str[4][6];int main(){#ifdef DEBUG freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout);#endif scanf("%d",&t); while(t--){ scanf("%s",str[1]+1); scanf("%s",str[2]+1); scanf("%s",str[3]+1); if(str[1][1]==str[1][2]&&str[1][2]==str[1][3]&&str[1][1]!='.'){ cout << str[1][1] << endl; continue; } if(str[2][1]==str[2][2]&&str[2][2]==str[2][3]&&str[2][1]!='.'){ cout << str[2][1] << endl; continue; } if(str[3][1]==str[3][2]&&str[3][2]==str[3][3]&&str[3][1]!='.'){ cout << str[3][1] << endl; continue; } if(str[1][1]==str[2][1]&&str[2][1]==str[3][1]&&str[1][1]!='.'){ cout << str[1][1] << endl; continue; } if(str[1][2]==str[2][2]&&str[2][2]==str[3][2]&&str[1][2]!='.'){ cout << str[1][2] << endl; continue; } if(str[1][3]==str[2][3]&&str[2][3]==str[3][3]&&str[1][3]!='.'){ cout << str[1][3] << endl; continue; } if(str[1][3]==str[2][2]&&str[2][2]==str[3][1]&&str[1][3]!='.'){ cout << str[1][3] << endl; continue; } if(str[1][1]==str[2][2]&&str[2][2]==str[3][3]&&str[1][1]!='.'){ cout << str[1][1] << endl; continue; } cout << "Waiting..." << endl; } //cout << "Hello world!" << endl; return 0;}

这是一个简单的纸牌题

/**@Author:   STZG*@Language: C++*/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#define DEBUG#define RI register intusing namespace std;typedef long long ll;//typedef __int128 lll;const int N=100000+10;const int MOD=1e9+7;const double PI = acos(-1.0);const double EXP = 1E-8;const int INF = 0x3f3f3f3f;int t,n,m,k,q,ans;int a;char str;int p(int a,int b,int c){ if(a==b&&b==c){ return 3; } if(a==b||b==c||a==c){ return 2; } return 1;}int main(){#ifdef DEBUG freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout);#endif scanf("%d",&t); int a,b,c; int x,y,z; while(t--){ scanf("%d%d%d",&a,&b,&c); n=p(a,b,c); scanf("%d%d%d",&x,&y,&z); m=p(x,y,z); if(n>m){ cout << "A" << endl; }else if(n
x){ cout << "A" << endl; }else if(a
q){ cout << "A" << endl; }else if(k
tmp2[3]){ cout << "A" << endl; }else if(tmp1[3]
tmp2[2]){ cout << "A" << endl; }else if(tmp1[2]
tmp2[1]){ cout << "A" << endl; }else if(tmp1[1]

 

转载地址:http://wjzof.baihongyu.com/

你可能感兴趣的文章
面试中的这些坑,你踩过几个?
查看>>
socket,tcp,http三者之间的区别和原理
查看>>
Spring AOP 最热门面试题及答案
查看>>
Union和Union All到底有什么区别
查看>>
java读取txt文件,使用正则表达式获取信息
查看>>
exists\not exists和in\not in效率
查看>>
SQL删除重复数据只保留一条
查看>>
SonarQube 跳过指定检查
查看>>
java map遍历使用并行流
查看>>
jsp页面中jstl标签详解 包括< c> <c> <c>
查看>>
hibernate hql 同时更新多个字段
查看>>
oracle键、索引、约束及其区别
查看>>
解决activemq多消费者并发处理
查看>>
UDP连接和TCP连接的异同
查看>>
hibernate 时间段查询
查看>>
java操作cookie 实现两周内自动登录
查看>>
jstl 中获得session 里面值sessionScope
查看>>
Tomcat 7优化前及优化后的性能对比
查看>>
VisualVM 提示 tomcat 不受此jvm支持解决办法
查看>>
如何在excel每一行数据后面都加一个逗号
查看>>