摘要:做题地址:http://acm.hdu.edu.cn/diy/contest_login.php?cid=16649Problem K: HDU 1061//计算+规律,可以用纯规律for(i=0; i<N%4-1; i++) N%4是规律推出来的最小公倍数#include <stdio.h>int main(){ int T, N, i, ans, tmp; scanf("%d", &T"); while(T--) { scanf("%d", &N"); if(N>10) tmp = N%10
阅读全文
随笔分类 - 集训练习题解
摘要:做题地址:http://acm.hdu.edu.cn/diy/contest_login.php?cid=16636Problem A: HDU1040排序题,可以直接使用c++提供的排序,如果是JAVA,也可以使用自带的排序方法。C语言需要自己写排序算法。#include<cstdio>#include<iostream>#include<algorithm>using namespace std;int sequence[1005];int t,n;int main(){ while(scanf("%d",&t)==1){ w
阅读全文
摘要:做题地址:http://acm.hdu.edu.cn/diy/contest_login.php?cid=16600Problem A :HDU1172//枚举#include <stdio.h>int check1(int num1, int num2, int t){ int a[4], b[4]; int c[4]; int i, j; for(i=0; i<4; i++) { a[i] = num1%10; num1 /= 10; b[i] = num2%10; num2 /= 10; ...
阅读全文
摘要:做题地址:http://acm.hdu.edu.cn/diy/contest_login.php?cid=16582杭电1089-1096http://acm.hdu.edu.cn/listproblem.php?vol=1主要考点是输入输出,以下全部是C代码。HDU1089#include <stdio.h>int main(){ int a, b; while(scanf("%d%d", &a, &b) != EOF) { printf("%d\n", a+b); } return 0;}HDU1090#include &
阅读全文

浙公网安备 33010602011771号