楼主标题改换换
楼主标题改换换
2006-12-29 17:16
2006-12-29 17:24

2006-12-30 13:29
2006-12-30 14:28
2006-12-30 23:06
#include <stdio.h>
#define max(x,y) x>y?x,y
int process(int n);
void main()
{
int n,i,s;
printf("Input your number!");
do
{
scanf("%d",&n);
}
while(n!=0);
if(n<1||n>4)
printf("Input error!");
s=process(n);
printf("%d",s);
}
int process(int n)
{
int t[5]={0};
int a,b,c,d;
if(n==0) t[0]++;
else if(n==1) t[1]++;
else if(n==2) t[2]++;
else if(n==3) t[3]++;
else t[4]++;
a=max(t[0],t[1]);
b=max(a,t[2]);
c=max(b,t[3]);
d=max(c,t[4]);
return(d);
}
自己想了下 就这水平了 绝对有错误 希望大家指点一下
2006-12-31 00:19
2006-12-31 06:46
2007-01-01 18:35
2007-01-05 05:16