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

            97精品久久天干天天天按摩 | 国产一区二区三区久久| 国内精品久久久人妻中文字幕| 午夜精品久久久久久99热| 国产91色综合久久免费分享| 久久99精品国产99久久6| 大香伊人久久精品一区二区| 天天综合久久久网| 午夜天堂精品久久久久| 久久久中文字幕日本| 国产欧美久久久精品| 91麻豆国产精品91久久久| 国产ww久久久久久久久久| 久久综合国产乱子伦精品免费| 久久亚洲av无码精品浪潮| 国内精品久久久久| 国产A级毛片久久久精品毛片| 国产A级毛片久久久精品毛片| 久久国产精品无码HDAV| 中文国产成人精品久久不卡| 久久久久国产一区二区三区| 国内精品久久久久久野外| 久久精品人人做人人妻人人玩| 久久久午夜精品| 久久久久久国产a免费观看黄色大片| 久久中文字幕一区二区| 久久九九亚洲精品| 91超碰碰碰碰久久久久久综合| 狠狠干狠狠久久| 韩国三级大全久久网站| 久久国产精品一区二区| 97热久久免费频精品99| 久久不射电影网| 亚洲成色999久久网站| 99久久精品免费国产大片| 青青热久久综合网伊人| 996久久国产精品线观看| 九九久久99综合一区二区| 精品久久久久久国产三级| 久久男人中文字幕资源站| 武侠古典久久婷婷狼人伊人|