• <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
            貌似。。哈工大的機試題都極其的水。。。

            1. 數組逆置
               本來想寫個遞歸的。。但是覺得實在是畫蛇添足。。
            //2011年哈爾濱工業大學計算機研究生機試題 數組逆置
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            char s[1000];

            int main() {
                
            int i;
                
            while(gets(s) != NULL) {
                    
            for(i = strlen(s) - 1; i >= 0--i) putchar(s[i]);
                    puts(
            "");
                }

                
            return 0;
            }


            2. 最大公約數
               大水不解釋
            //2011年哈爾濱工業大學計算機研究生機試題 最大公約數 
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>
            #include
            <algorithm>
            using namespace std;

            int gcd(int a, int b) {
                
            if(!b) return a;
                
            return gcd(b, a % b);
            }


            int main() {
                
            int a, b;
                
            while(~scanf("%d %d"&a, &b)) {
                    
            if(a < b) swap(a, b);
                    printf(
            "%d\n", gcd(a, b));
                }

                
            return 0;
            }


            3. 眾數
               memset不小心開到while外面去了。。WA*1
            //2011年哈爾濱工業大學計算機研究生機試題 眾數 
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            int fg[20];

            int main() {
                
            int mx, mk, a, i;
                
            while(~scanf("%d"&a)) {
                    memset(fg, 
            0sizeof(fg));
                    fg[a]
            ++;
                    
            for(i = 1; i < 20++i) {
                        scanf(
            "%d"&a);
                        fg[a]
            ++;   
                    }

                    mx 
            = 0;
                    
            for(i = 1; i <= 10++i) {
                        
            if(fg[i] > mx) {
                            mx 
            = fg[i];
                            mk 
            = i;
                        }

                    }

                    printf(
            "%d\n", mk);
                }

                
            return 0;
            }

            久久久久国产日韩精品网站| 伊人伊成久久人综合网777| 国内精品久久久久久野外| 国产精品综合久久第一页| 国内精品伊人久久久久妇| 久久er99热精品一区二区| 久久精品成人欧美大片| 久久久久亚洲AV无码专区体验| 成人精品一区二区久久久| 亚洲国产精品久久久天堂 | 国产A级毛片久久久精品毛片| 99国产欧美精品久久久蜜芽| 伊人久久大香线蕉综合5g| 精品熟女少妇aⅴ免费久久| 久久精品国产亚洲AV香蕉| 久久这里只有精品首页| 久久精品无码一区二区日韩AV | 久久精品国产第一区二区| 久久国产色AV免费观看| 久久久精品国产免大香伊 | 精品国产乱码久久久久软件| 久久人妻少妇嫩草AV无码蜜桃| 精品久久一区二区三区| 欧美噜噜久久久XXX| 亚洲狠狠婷婷综合久久蜜芽 | 久久99精品国产99久久6| 欧美日韩中文字幕久久伊人| 97久久综合精品久久久综合| 一本一道久久综合狠狠老| 亚洲精品97久久中文字幕无码| 国产亚洲精午夜久久久久久| 精品久久久久一区二区三区| 久久97久久97精品免视看| 国产成人精品久久一区二区三区av | 久久精品国产亚洲AV大全| 色综合久久久久无码专区 | 亚洲国产精品久久久久| 99久久99久久精品国产| 久久精品国产清自在天天线| 久久无码国产| 亚洲色大成网站WWW久久九九|