• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Uriel's Corner

            Research Associate @ Harvard University / Research Interests: Computer Vision, Biomedical Image Analysis, Machine Learning
            posts - 0, comments - 50, trackbacks - 0, articles - 594
            水得不行的一套題... 確創(chuàng)造了無數(shù)的WA... ...

            1. 百雞問題
                大水不解釋
            //2009年哈爾濱工業(yè)大學計算機研究生機試題 百雞問題
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            double n;

            int main() {
                
            int i, j, k;
                
            while(~scanf("%lf"&n)) {
                    
            for(i = 05 * i <= n; ++i) {
                        
            for(j = 03 * j <= n; ++j) {
                            
            if((100 - i - j) / 3.0 + 5 * i + 3 * j <= n) printf("x=%d,y=%d,z=%d\n", i, j, 100 - i - j);
                        }

                    }

                }

                
            return 0;
            }


            2. 求最大值
                大水不解釋
            //2009年哈爾濱工業(yè)大學計算機研究生機試題 求最大值
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            int main() {
                
            int mx, a, i;
                
            while(~scanf("%d"&mx)) {
                    
            for(i = 1; i < 10++i) {
                        scanf(
            "%d"&a);
                        
            if(a > mx) mx = a;
                    }

                    printf(
            "max=%d\n", mx);
                }

                
            return 0;
            }


            3. 素數(shù)判定
                WA一次... 忘記特判負數(shù)了...
            //2009年哈爾濱工業(yè)大學計算機研究生機試題 素數(shù)判定
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            int main() {
                
            int i, n, ok;
                
            while(~scanf("%d"&n)) {
                    
            if(n <= 1{
                        puts(
            "no");
                        
            continue;
                    }

                    ok 
            = 1;
                    
            for(i = 2; i * i <= n; ++i) {
                        
            if(n % i == 0{
                            ok 
            = 0;
                            
            break;
                        }

                    }

                    
            if(!ok) puts("no");
                    
            else
                        puts(
            "yes");
                }

                
            return 0;
            }


            4. 判斷三角形類型
                各種WA之后發(fā)現(xiàn)... sort忘寫了... 深刻自我檢討... ...
            //2009年哈爾濱工業(yè)大學計算機研究生機試題 判斷三角形類型
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>
            #include
            <algorithm>
            using namespace std;
            double a[3];

            int main() {
                
            while(~scanf("%lf %lf %lf"&a[0], &a[1], &a[2])) {
                    sort(a, a 
            + 3);
                    
            if(a[2* a[2== a[0* a[0+ a[1* a[1]) puts("直角三角形");
                    
            else if(a[2* a[2< a[0* a[0+ a[1* a[1]) puts("銳角三角形");
                    
            else
                        puts(
            "鈍角三角形");
                }

                
            return 0;
            }


            5. 字符串去特定字符
                這題WA得有點小莫名... 第二個字符getchar讀就WA, 跟第一個字符串一樣用gets讀就AC...
            //2009年哈爾濱工業(yè)大學計算機研究生機試題 字符串去特定字符
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            char s[1000000], c[5];

            int main() {
                
            int i;
                
            while(gets(s) != NULL) {
                    gets(c);
                    
            for(i = 0; s[i]; ++i) {
                        
            if(s[i] != c[0]) putchar(s[i]);
                    }

                    puts(
            "");
                }

                
            return 0;
            }
            99久久99久久久精品齐齐| 欧洲性大片xxxxx久久久| 久久人人爽人人爽人人AV| 国内精品久久久久久99| 久久香蕉国产线看观看99| 亚洲日韩欧美一区久久久久我| 欧美亚洲国产精品久久| 久久发布国产伦子伦精品| 久久人妻少妇嫩草AV蜜桃| 色综合久久无码五十路人妻| 国产毛片久久久久久国产毛片 | A级毛片无码久久精品免费| 欧美精品丝袜久久久中文字幕 | 久久精品人人做人人爽电影蜜月| 国产精品久久久久久久久鸭| 久久久久亚洲AV综合波多野结衣| 久久国产精品成人片免费| 亚洲国产成人久久综合一区77 | 久久久久国产精品人妻| 国产成人久久精品区一区二区| 天天综合久久一二三区| 国产一区二区三区久久精品| 久久亚洲精品无码aⅴ大香| 国产精品免费久久久久影院| 久久婷婷五月综合97色| 婷婷久久综合九色综合绿巨人 | 亚洲美日韩Av中文字幕无码久久久妻妇| 久久综合给合久久狠狠狠97色| 久久综合狠狠综合久久97色| 国产成人精品久久亚洲高清不卡 | 亚洲∧v久久久无码精品| 久久精品人人做人人爽电影| 热RE99久久精品国产66热| 99久久精品无码一区二区毛片| 国产成人精品久久二区二区| 精品国产乱码久久久久久1区2区| 少妇精品久久久一区二区三区 | 狠狠色丁香久久婷婷综合图片| 久久久久国产成人精品亚洲午夜| 国产亚洲色婷婷久久99精品91 | 欧美与黑人午夜性猛交久久久 |