ACM
lynn83
这个作者很懒,什么都没留下…
展开
-
Tongji Online Judge ID:1012
Tongji Online JudgeProblem 1012: 约瑟夫问题#includetypedef struct person{ int index; int key;} person;int main(){ person a[101]; int start,cur=1,i; while(scanf("%d %d", &原创 2005-10-25 18:27:00 · 945 阅读 · 0 评论 -
Tongji Online Judge ID:1019
Tongji Online JudgeProblem 1019: 输入三个自然数#include#define print printf("(%d,%d)", k, m)#define endl printf("/n")int main(){ int i, j, k, m, n; while(scanf("%d%d%d", &n, &i, &j)!=EOF) {原创 2005-11-09 16:11:00 · 956 阅读 · 0 评论 -
Tongji Online Judge ID:1002
Tongji Online JudgeProblem 1002: 全排序问题#include#define MAX 10void p(char *);void del(char *, int, char *);void print();char str_num[MAX+1], out[MAX];int main(){ int i; char ch; for原创 2005-10-19 13:44:00 · 909 阅读 · 0 评论 -
Tongji Online Judge ID:1015
Tongji Online JudgeProblem 1015: 行编辑器此题仍没有通过,但自己验证是通过了的,不知道是什么原因......#include#define InitStack() (i=0)#define ClearStack() (i=0)#define Push(ch) (S[++i]=ch)#define Pop() (S[i--])char S[80];int i,j;in原创 2005-10-21 18:36:00 · 806 阅读 · 0 评论 -
Tongji Online Judge ID:1005
Tongji Online JudgeProblem 1005: 母牛生小牛#includeint main(){ int i,n; long f[51]={0,1,1,1}; for(i=4; i while(scanf("%d", &n)!=EOF) { printf("%ld/n", f[n]);原创 2005-10-19 14:34:00 · 856 阅读 · 0 评论 -
Tongji Online Judge ID:1010
Tongji Online JudgeProblem 1010: 数素数#include#define set0(m, n) ((m)&~(1typedef unsigned char Byte;Byte count(Byte num){ Byte t=0; while(num!=0) { t+=num%2;原创 2005-11-05 17:00:00 · 1259 阅读 · 0 评论 -
Tongji Online Judge ID:1013
Tongji Online JudgeProblem 1013: 高精度整数去位去最小问题#include#include#define MAX 240int min(char * str, int cur, int end){ int i, min=cur; for(i=cur+1; i if(str[i]原创 2005-11-06 16:19:00 · 928 阅读 · 0 评论 -
Tongji Online Judge ID:1011
Tongji Online JudgeProblem 1011: 阶乘末尾非零数求和#include"stdio.h"#include"math.h"#define mask_5(s) ((s#define mask_6(s) ((sint main(){ unsigned int i, j, k, n, num; unsigned long sum, sum_ever原创 2005-10-30 10:10:00 · 982 阅读 · 0 评论 -
Tongji Online Judge ID:1006
Tongji Online JudgeProblem 1006: 敲七#includeint main(){ int i,m,n; scanf("%d", &n); for(i=1; i if(i%7==0) printf("%d/n", i); else {原创 2005-10-19 14:27:00 · 965 阅读 · 0 评论 -
Tongji Online Judge ID:1014
Tongji Online JudgeProblem 1014: 阶乘结果末尾有多少零?#includeint main(){ int n, m; while(scanf("%d", &m)!=EOF) { n=0; while(m){ m=m/5;原创 2005-10-21 16:20:00 · 826 阅读 · 0 评论 -
Tongji Online Judge ID:1018
Tongji Online JudgeProblem 1018:编制一个乘法运算的程序#includeint main(){ int x,y; while(scanf("%d%d", &x, &y)!=EOF) { printf("%7d/n",x); printf("*%6d/n",y);原创 2005-11-09 16:07:00 · 921 阅读 · 0 评论