• <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
            水得不行的一套題... 確創造了無數的WA... ...

            1. 百雞問題
                大水不解釋
            //2009年哈爾濱工業大學計算機研究生機試題 百雞問題
            #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年哈爾濱工業大學計算機研究生機試題 求最大值
            #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. 素數判定
                WA一次... 忘記特判負數了...
            //2009年哈爾濱工業大學計算機研究生機試題 素數判定
            #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之后發現... sort忘寫了... 深刻自我檢討... ...
            //2009年哈爾濱工業大學計算機研究生機試題 判斷三角形類型
            #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年哈爾濱工業大學計算機研究生機試題 字符串去特定字符
            #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精品国产综合久久久久五月天| 亚洲狠狠久久综合一区77777| 久久久久综合网久久| 亚洲国产精品无码久久| 久久香蕉国产线看观看精品yw| 久久精品成人欧美大片| 久久人人爽人人爽人人爽| 偷偷做久久久久网站| 亚洲乱码中文字幕久久孕妇黑人| 无码人妻精品一区二区三区久久久 | 国产色综合久久无码有码| 中文字幕久久亚洲一区| 精品综合久久久久久97| 久久99热只有频精品8| 国产69精品久久久久777| 99国内精品久久久久久久| 久久久久久av无码免费看大片| 欧美麻豆久久久久久中文| 国产精品久久久久免费a∨| 亚洲女久久久噜噜噜熟女| 久久精品国产亚洲av日韩| 狠色狠色狠狠色综合久久| 久久久久亚洲AV成人网| 伊人久久无码中文字幕| 精品人妻久久久久久888| 精品乱码久久久久久夜夜嗨| 7777精品伊人久久久大香线蕉| 久久久精品人妻一区二区三区蜜桃 | 国产精品久久毛片完整版| 久久这里有精品视频| 日韩精品无码久久久久久| 国产精品欧美久久久久天天影视| 亚洲欧美成人久久综合中文网 | 久久久久亚洲AV无码观看| 久久久久免费精品国产| 久久久久久精品免费看SSS| 国产美女久久精品香蕉69| 久久精品国产免费观看三人同眠| 亚洲国产精品久久| 久久综合香蕉国产蜜臀AV| 日产久久强奸免费的看|