TC工作室白银局 [Cloned]
专题链接:https://vjudge.net/contest/340942#overview
A - 进制转换原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2031
#include int num[1000];int main(){ int n,r,c; while(~scanf("%d %d", } if(n<0) { printf("-"); n=-n; } c=0; while(n) { num[c]=n%r; n/=r; c++; } for(int i=c-1;i>=0;i--) { if(num[i]>=10) { printf("%c",'A'+num[i]-10); } else { printf("%d",num[i]); } } printf("\n"); } return 0;}
B - 杨辉三角原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2032代码:
#include int main(){ int s = 1, h; int i, j; while(~scanf("%d", for (i = 2; i <= h; s = 1, i++) { printf("1 "); for (j = 1; j <= i - 2; j++) printf("%d ", (s = (i - j) * s / j)); printf("1\n"); } printf("\n"); } return 0;}
C - 人见人爱A+B原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2033代码:
#includeint main(){ int h1,h2,m1,m2,s1,s2,h=0,m=0,s=0; int n; scanf("%d", while(n--) { scanf("%d %d %d %d %d %d", s=(s1+s2)%60; m=((m1+m2)+(s1+s2)/60)%60; h=(h1+h2)+((m1+m2)+(s1+s2)/60)/60; printf("%d %d %d\n",h,m,s); } return 0;}
D - 人见人爱A-B原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2034代码:
#include #include #include using namespace std;int main(){ int a[105]; int b[105]; int c[105]; int d[105]; int n,m,i,j,k; while(~scanf("%d %d", if(n==0 } for(i=0; i
#include int PowerMod(int a, int b, int c){ int ans = 1; a = a % c; while(b>0) { if(b % 2 == 1) ans = (ans * a) % c; b = b/2; a = (a * a) % c; } return ans;}int main(){ int a,b,x; while(~scanf("%d %d", } x=PowerMod(a,b,1000); printf("%d\n",x); } return 0;}
F - 改革春风吹满地原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2036代码:
- 点赞1
- 收藏
- 分享
- 文章举报