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

            久久综合久久性久99毛片| 看全色黄大色大片免费久久久| 综合网日日天干夜夜久久| 久久精品欧美日韩精品| 99国内精品久久久久久久| 国产69精品久久久久观看软件| 九九久久自然熟的香蕉图片| 久久无码一区二区三区少妇| 久久精品国产亚洲av水果派| 精品久久久久中文字| 久久99精品久久久久久久不卡| 久久精品免费一区二区| 久久国产免费直播| 久久精品中文騷妇女内射| 波多野结衣久久精品| 久久精品成人影院| 久久精品国产一区| 精品无码久久久久久午夜| 午夜精品久久久久久久无码| 性色欲网站人妻丰满中文久久不卡| 国产免费久久精品99久久| 久久国产成人精品麻豆| 日日噜噜夜夜狠狠久久丁香五月| 人妻无码精品久久亚瑟影视| 狠狠色综合网站久久久久久久| 久久婷婷五月综合97色| 亚洲精品国精品久久99热一| 久久国产亚洲精品| 欧美日韩精品久久免费| 久久笫一福利免费导航| 日韩久久久久中文字幕人妻| 国产AⅤ精品一区二区三区久久| 久久九九亚洲精品| 国产精品成人精品久久久| 99久久精品国产综合一区| 久久久久99精品成人片牛牛影视| 久久久精品国产亚洲成人满18免费网站 | 久久亚洲国产欧洲精品一| 久久噜噜电影你懂的| 久久中文字幕一区二区| 日韩人妻无码精品久久免费一|