
ACM_基础题
Summer先生_
这个作者很懒,什么都没留下…
展开
-
1083 Cantor表(模拟)
思路:找规律吧原创 2014-10-09 13:13:25 · 686 阅读 · 0 评论 -
UVa 272 TEX Quotes
#includeint main(void){ //freopen("input.txt","r",stdin); int c, q = 1; while((c = getchar()) != EOF) { if(c == '"') { printf("%s", q ? "``" : "''"); q = !q; }else{ printf("%c", c);原创 2014-08-04 22:44:35 · 832 阅读 · 0 评论 -
UVa 340 Master-Mind Hints
MasterMind is a game for two players. One of them, Designer, selects a secret code. The other, Breaker, tries to break it. A code is no more than a row of colored dots. At the beginning of a game, t原创 2014-08-05 21:29:55 · 535 阅读 · 0 评论 -
UVa 1583 Digit Generator
For a positive integer N , the digit-sum of N is defined as the sum of N itself and its digits. When M is the digitsum of N , we call N a generator of M .For example, the digit-sum of 245 is 256 (原创 2014-08-05 22:03:37 · 733 阅读 · 0 评论 -
UVa 1584 Circular Sequence
Some DNA sequences exist in circular forms as in the following figure, which shows a circular sequence ``CGAGTCAGCT", that is, the last symbol ``T" in ``CGAGTCAGCT" is connected to the first symbol ``原创 2014-08-05 22:38:09 · 668 阅读 · 0 评论 -
UVa 10082 WERTYU
#includeint main(void){ //freopen("input.txt","r",stdin); char s[] = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./"; int i; char c; while((c = getchar()) != EOF) { for(i = 0; s[i] && s[i]原创 2014-08-04 22:43:17 · 881 阅读 · 0 评论 -
打印素数表
#include int isPrime(int x,int KnowPrimes[],int numberOfKnowPrimes);int main(){ const int number=100; int prime[number]={2}; int count=1; int i=3; while(count<number){ if(isPrime(i ,prime,原创 2014-10-11 18:36:33 · 910 阅读 · 0 评论 -
1011 数的计算
最简单的递推。原创 2014-10-11 22:03:29 · 937 阅读 · 0 评论 -
1474 十进制转m进制+1475 m进制转十进制
#include #include using namespace std;int main(){ //freopen("in.txt","r",stdin); int n,m; while(scanf("%d%d",&n,&m)!=EOF) { int a[100]; int i; for (i = 0; n > 0 ; ++i) { a[i]=n%m;原创 2014-10-11 21:34:00 · 813 阅读 · 0 评论 -
1978 Fibonacci数列 3
最简单的递归会爆炸,稍微改进一下,原创 2014-10-10 12:38:44 · 697 阅读 · 0 评论 -
1160 蛇形矩阵(模拟)
占坑明天写。原创 2014-10-09 22:13:00 · 938 阅读 · 0 评论 -
1012 最大公约数和最小公倍数问题
简单的枚举规律:原创 2014-10-10 15:26:01 · 1020 阅读 · 0 评论 -
1430 素数判定
思路:简单的素数判断,对效率yao'q原创 2014-10-10 12:21:10 · 926 阅读 · 0 评论 -
【HDU】统计元音
题目地址:HDU 2027主要是因为忘了清除缓冲区的换行符还WA了一发#include #include #include #include #include #include #include #include using namespace std;#define read() freopen("in.txt", "r", stdin)#define write原创 2015-01-07 13:48:25 · 748 阅读 · 0 评论