• <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;
            }

            国产亚洲精午夜久久久久久 | 久久水蜜桃亚洲av无码精品麻豆| 奇米影视7777久久精品人人爽| 久久久久亚洲av综合波多野结衣| 无码人妻久久一区二区三区免费| 久久中文字幕一区二区| 思思久久99热免费精品6| 亚洲精品乱码久久久久久按摩| 51久久夜色精品国产| 2021国产精品久久精品| 99热成人精品免费久久| 无遮挡粉嫩小泬久久久久久久| 久久久久国产精品三级网| 亚洲香蕉网久久综合影视| 国产亚州精品女人久久久久久| 国产产无码乱码精品久久鸭| 日韩中文久久| 精品人妻伦九区久久AAA片69| 久久久久久夜精品精品免费啦| 欧美成人免费观看久久| 成人a毛片久久免费播放| 久久精品国产亚洲AV大全| 久久人人爽人人爽人人爽| 久久久久国产精品嫩草影院| 99国内精品久久久久久久| 国内精品久久久久影院优| 久久久久亚洲AV无码永不| 久久亚洲欧美国产精品| 亚洲色大成网站www久久九| 久久无码一区二区三区少妇| 久久久免费观成人影院| 国产精品热久久毛片| 精品久久久久中文字| 久久免费99精品国产自在现线| 国产精品久久久久久久午夜片 | 久久亚洲av无码精品浪潮| 91精品婷婷国产综合久久| 精品久久久久久无码免费| 久久男人中文字幕资源站| 武侠古典久久婷婷狼人伊人| 99久久做夜夜爱天天做精品|