• <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;
            }
            成人午夜精品久久久久久久小说| 欧美噜噜久久久XXX| 久久久久无码精品| 综合网日日天干夜夜久久| 久久久一本精品99久久精品66 | 久久播电影网| 少妇无套内谢久久久久| 久久精品国产亚洲网站| 久久亚洲国产最新网站| 青青草原综合久久| 久久国产精品一国产精品金尊| 国产激情久久久久影院老熟女 | 国产精品99久久免费观看| 久久久精品久久久久久| 99久久婷婷国产综合亚洲| 亚洲精品成人网久久久久久| 精品久久久久久国产| 久久亚洲AV无码精品色午夜| 狠狠久久综合| 777久久精品一区二区三区无码 | 久久精品麻豆日日躁夜夜躁| 久久男人中文字幕资源站| 91久久福利国产成人精品| 久久精品www人人爽人人| 综合网日日天干夜夜久久| 亚洲精品无码久久毛片| 国产精品美女久久久久AV福利| 久久精品夜夜夜夜夜久久| 亚洲AV日韩AV天堂久久| 久久久久久久综合狠狠综合| 久久久久久久综合日本| 国产精品综合久久第一页| 亚洲国产精久久久久久久| 久久免费美女视频| 7国产欧美日韩综合天堂中文久久久久 | 久久久久久A亚洲欧洲AV冫| 99热热久久这里只有精品68| 久久久久夜夜夜精品国产| 久久九九全国免费| 国内精品久久久久久麻豆| 久久午夜无码鲁丝片午夜精品|