wan玩得好手游 » 手机游戏 » 今天先来玩个小游戏

今天先来玩个小游戏

来源:互联网 编辑:wan玩得好手游小编 更新:2024-11-07 07:38:25 人气:

有一段代码:

#include

#include

void main()

{

char a,x;

static int b[255],c[255],i,k;

FILE *y;

for(i=0;i

b[i]=i;

y=fopen("C:Users吃瓜群众Desktop胡鹏宾-2018901231暑假文件kjv.txt","r");

if(y==NULL)

printf("打开文件出错!");

x=fgetc(y);

while(!feof(y))

{

for(i=0;i

{a=b[i];

if(x==a)

c[i]++;

}

x=fgetc(y);

}

for(i=0;i

if(c[i]!=0)

k++;

fclose(y);

for(i=0;i

if(c[i]!=0)

printf("字符%c的个数为%d ",b[i],c[i]);

printf("有%d种字符",k);




}

下面又是时间的转化

#include

void main()

{

int date,month,year,i,j;

char a[12][12]={"January","February","March","April",

"May","June","July","August","September","October","November","December"} ;

while(1)

{

printf("请输入日期如:(2019-7-8) ");

scanf("%d-%d-%d",&year,&month,&date);

if((date

{for(i=0;i

if(month==i+1)

switch(date)

{

case 1:case 11:case 21:case 31:

printf("%dst  ",date);

for (j=0;j

printf("%c",a[i][j]);

printf(",%d ",year);

break;

case 2:

printf("%dnd  ",date);

for (j=0;j

printf("%c",a[i][j]);

printf(",%d ",year);

break;

case 3:

printf("%drd  ",date);

for (j=0;j

printf("%c",a[i][j]);

printf(",%d ",year);

break;

default:

printf("%dth  ",date);

for (j=0;j

printf("%c",a[i][j]);

printf(",%d ",year);

}}

else 

printf("你输入有误,请重新输入 ");}


}


欢迎玩家到【 wan玩得好手游】查看最新变态版手游攻略,只需要在百度输入【 wan玩得好手游】就可以浏览最新上线送满vip的变态手游攻略了,更多有关手游的攻略和资讯,敬请关注玩得好手游网!

标签: 今天先来玩个小游戏
玩得好手游为玩家们提供非常多最新好玩的手游下载,热门的手机app下载,常用安卓应用软件下载,热门手游排行榜发现更多好游戏,还为玩家推荐近期热门手游攻略,手游公益服。 简繁切换 繁體中文