• <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;
            }
            久久久久亚洲Av无码专| 国产三级久久久精品麻豆三级 | 嫩草影院久久99| 精品免费久久久久国产一区| 欧美日韩精品久久久久| 亚洲中文字幕无码久久综合网| 国产韩国精品一区二区三区久久 | 久久国产劲爆AV内射—百度| 精品久久久久久久无码| 久久性生大片免费观看性| 国产精品久久99| 亚洲AV无码久久精品狠狠爱浪潮 | 亚洲国产小视频精品久久久三级 | 亚洲一区二区三区日本久久九| 色婷婷久久久SWAG精品| 人人狠狠综合久久亚洲婷婷| 久久www免费人成看片| 三级韩国一区久久二区综合 | 久久乐国产精品亚洲综合| 狠狠久久亚洲欧美专区| 久久久久AV综合网成人 | 亚洲狠狠婷婷综合久久久久| 欧美性猛交xxxx免费看久久久| 精品熟女少妇av免费久久| 久久综合九色综合网站| 青青热久久国产久精品 | 色诱久久久久综合网ywww| 免费久久人人爽人人爽av| 久久免费国产精品| 久久综合久久鬼色| 久久久久九国产精品| 国产精品综合久久第一页| 国产精品女同一区二区久久| 精品久久香蕉国产线看观看亚洲| 久久久久人妻一区精品色| 久久精品中文无码资源站 | 看全色黄大色大片免费久久久 | 国产精品成人99久久久久91gav| 久久―日本道色综合久久| 国产精品伊人久久伊人电影| 久久精品无码一区二区三区日韩|