精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • Write a program which asks the user for four numbers and then tells them one of the following:

    Write a program which asks the user for four numbers and then tells them one of the following:
    · That there were more even numbers than odd numbers
    · That there were more odd numbers than even numbers
    · That there were the same number of even and odd numbers
    英語人氣:973 ℃時(shí)間:2020-05-12 03:43:18
    優(yōu)質(zhì)解答
    #include
    void main(void)
    {
    int n,number[4],even,odd;
    even=odd=0;
    printf("please input 4 interger numbers:\n");
    for(n=0;n能排下版嗎? 謝謝VC6標(biāo)準(zhǔn)代碼模式,你可以自行調(diào)整,如需要解釋我等下重新加上注釋我用的是python2.7. 直接復(fù)制好像不行。。那我再發(fā)一下代碼,增加了注釋,自己看看能否用。可能平臺(tái)不同,程序有所不同,具體python2.7怎么用我也不清楚。你這個(gè)發(fā)到C/C++了。#include void main(void)//vc6平臺(tái)通過,其他平臺(tái)可能為main()即可{ int n,number[4],even,odd; even=odd=0; printf("please input 4 interger numbers:\n");//提示請輸入4個(gè)整數(shù) for(n=0;n<=3;n++) {scanf("%d",&number[n]);//請輸入4個(gè)整數(shù) } for(n=0;n<=3;n++) {if(number[n]%2==0) even++;//統(tǒng)計(jì)偶數(shù)數(shù)目else if(number[n]%2==1) odd++;//統(tǒng)計(jì)奇數(shù)數(shù)目 } if(even==odd)//如果奇數(shù)偶數(shù)相等printf("That there were the same number of even and odd numbers\n"); else if (even>odd)//如果偶數(shù)多于奇數(shù)printf("That there were more even numbers than odd numbers\n"); else if(even
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版