亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

        2014年計算機(jī)二級C語言程序設(shè)計真題及答案

        字號:

        #include
            #include
            void proc(int num,int*b,int*c)
            {
            int i,j,d,y;
            for(i=3;i<=num/2;i=i+2)
            //****found****
            { y=0;
            for(j=2;j<=sqrt((double)i);j++)
            if(i%j==0)y=0;
            if(y==l)
            //****found****
            { d=i-num;
            for(j=2;j<=sqrt((double)d);    j++)
            if(d%j==0)y=0;
            if(y==l)
            {*b=i;*c=d;)
            }
            }
            }   void main()
            { int mum,b,C;
            do
            { printf("\nlnput num:");
            scanf("%d",&num);)
            while(num%2); ’
            proc(num,&b,&c);
            printf("\n\n%d=%d+%d\n",num,b,c);
            }
            }
            請編寫函數(shù)proc(),其功能是:將str所指字符串中除下標(biāo)為偶數(shù),同時ASCII碼值為奇數(shù)的字符外,其余的字符都刪除,串中剩余字符所 形成的一個新串放在t所指的數(shù)組中。例如,若str所指字符串中的內(nèi)容為ABCDEFG12345,其中字符8的ASCII碼值為偶數(shù),所在元素的下標(biāo)為 奇數(shù),因此必須刪除;而字符A的ASCII碼值為奇數(shù),所在數(shù)組中的下標(biāo)為偶數(shù),因此不應(yīng)當(dāng)刪除。依此類推,最后t所指的數(shù)組中的內(nèi)容應(yīng)是ACEG。
            注意:部分源程序給出如下。
            請勿改動main()函數(shù)和其他函數(shù)中的任何內(nèi)容,僅在函數(shù)proc()的花括號中填入所寫的若干語句。
            試題程序:
            #include
            #include
            #include
            #include
            void proc(char*str,char t[])
            {
            }
            void main()
            {
            char str[100],t[100];
            system("CLS"):
            printf("\nPlease enter string str:");
            scanf("%s",str);
            proc(str,t);
            printf("\nThe result is:%s\n",t);
            }
            請補(bǔ)充main()函數(shù),該函數(shù)的功能是:從鍵盤輸入一組字符串,以“*”結(jié)束輸入,并顯示出這個字符串。
            例如,輸入ABCDEFG*,結(jié)果顯示ABCDEFG。