![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
#include<stdio.h>
int qiuhe(int jinpai,int yinpai,int tongpai);
void main()
{
int he;
he=qiuhe(51,34,21);
printf("%d",he);
}
int qiuhe(int jinpai,int yinpai,int tongpai)
{
return jinpai+ yinpai+ tongpai;
}
/*int jinpaishu1;//China integer
int jinpaishu2;//USA
int jinpaishu[3]={51,34,21};
int jinpai;
int i=0,sum=0;
printf("hello c!\n");
printf("北京\n");
printf("2008");
scanf("%d%d",&jinpaishu1,&jinpaishu2);
if(jinpaishu1>jinpaishu2)
printf("中国赢\n");
else
printf("美国赢\n");
scanf("%d",&jinpai);
switch(jinpai)
{
case 1: printf("%d\n",jinpaishu[0]);break;
case 2: printf("%d\n",jinpaishu[1]);break;
case 3: printf("%d\n",jinpaishu[2]);break;
default: printf("错误");
}
do
{
sum =sum+ jinpaishu[i];
i++;
}
while(i<=2);
for(i=0;i<=2;i++)
{
sum =sum+ jinpaishu[i];
}
printf("总数为%d\n",sum);
int jiangpaishu[2][2]={49,19,34,37};
int i,j,sum=0;
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
sum+=jiangpaishu[i][j];
}
printf("sum:%d",sum);*/
posted @
2008-08-28 10:26
emanlee
阅读(
251)
评论()
编辑
收藏
举报