當前位置:編程學習大全網 - 編程語言 - 小白編程示例

小白編程示例

# include & ltstdio.h & gt

# include & ltstring.h & gt

int?main(){

int?我?=?0;

夏爾?ch[3][100];

夏爾?max[100];

for(;?我?& lt?3;?++i)

scanf("%s ",ch[I]);

strcpy(最大值,ch[0]);

對於(我?=?1;?我?& lt?3;?++i)

if(strcmp(max,ch[i])?& lt?0)

strcpy(最大值,ch[I]);

printf("the?麥克斯。字符串?是嗎?:?%s ",max);

回歸?0;

}

# include & ltstdio.h & gt

# include & ltstring.h & gt

# include & ltctype.h & gt

//有壹篇文章* * *有三行字符,每行80個字符,分別統計英文大寫字母、小寫字母、數字、空格等字符的個數。

作廢?calc(char?ch[3][80],?int?col){

int?我?=?0,?j?=?9,?upp_cnt,?low_cnt,?num_cnt,space_cnt,?other _ cnt

upp_cnt?=?low_cnt?=?num_cnt?=?space_cnt?=?其他_cnt?=?0;

for(;?我?& lt?科爾?;?++i)

對於(j?=?0;?j?& lt?80;?++j){

if(isupper(ch[i][j]))

UPP _ cnt++;

不然呢?if(islower(ch[i][j]))

low _ cnt++;

不然呢?如果('?'?==?ch[i][j])

space _ cnt++;

不然呢?如果?(isdigit(ch[i][j]))

num _ cnt++;

其他

other _ cnt++;

}

printf("上?數數?:?%d\n ",upp_cnt?);

printf("更低?數數?:?%d\n ",low_cnt?);

printf("space?數數?:?%d\n ",space_cnt?);

printf("修女?數數?:?%d\n ",數量_計數?);

printf("其他?數數?:?%d\n ",other_cnt?);

}

int?main(){

夏爾?ch[3][80]?=?{

?{“餵,怎麽樣?我的?名字?是嗎?安。?我是?服用?安?美國人?口音?訓練。”},

?{“然後呢?我?有嗎?有償?$?100.?我?覺得?我?可以嗎?做什麽?它。?那又怎樣?堅持?它。”},

?{“現在?我?我嗎?制作?答?編程?然後呢。我?想要嗎?去哪?曼納吉?它。”}

};

calc(ch,3);

回歸?0;

這些都是很基本的,希望LZ好好學習,不要再談戀愛了。

  • 上一篇:什麽牌子的空調好用又省電
  • 下一篇:銑床工藝參數應該怎樣選擇?
  • copyright 2024編程學習大全網