• <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. 手機鍵盤
                這題竟然木有圖片。。還得找來手機對照。。題目本身木有難度。。
            //2008年清華大學計算機研究生機試題 手機鍵盤

            #include
            <stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            int a[] = {12312312312312312341231234};
            int t[] = {11122233344455566667778888};
            char s[110];

            int main() {
                
            int i, ans;
                
            while(gets(s) != NULL) {
                    ans 
            = 0;
                    
            for(i = 0; s[i]; ++i) {
                        
            if(!i) ans += a[s[i] - 'a'];
                        
            else {
                            ans 
            += a[s[i] - 'a'+ 2 * (t[s[i] - 'a'== t[s[i - 1- 'a']);
                        }

                    }

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

                
            return 0;
            }


            2. 進制轉換
               這題木有給范圍。。一開始也沒往那方面想, 總以為是輸出的大小寫不對。。結果WA到哭。。還無恥的上小號亂刷。。主號的AC率從77跌至60+。。
               想到可能要用大數之后。。又用JAVA偷懶了。。結果果斷主號和小號墊底。。
               膜拜此題用C寫900+B的大牛
               8.27: 膜拜完大牛代碼。。果然巧妙。。下次再不偷懶用JAVA了。。
            //2008年清華大學計算機研究生機試題 進制轉換

            import java.math.*;
            import java.util.*;

            public class Main {
                
            public static void main(String args[]) {
                    
            int m, n, i, l, k;
                    String ss;
                    
            char r[] = new char[1000];
                    
            char s[] = new char[1000];
                    BigInteger cnt;
                    Scanner cin 
            = new Scanner(System.in);
                    
            while(cin.hasNext()) {
                        m 
            = cin.nextInt();
                        n 
            = cin.nextInt();
                        ss 
            = cin.next();
                        l 
            = ss.length();
                        s 
            = ss.toCharArray();
                        cnt 
            = BigInteger.ZERO;
                        
            for(i = 0; i < l; ++i) {
                            cnt 
            = cnt.multiply(BigInteger.valueOf(m));
                            
            if(s[i] >= 'A' && s[i] <= 'Z') cnt = cnt.add(BigInteger.valueOf(s[i] - 'A' + 10));
                            
            else if(s[i] >= 'a' && s[i] <= 'z') cnt = cnt.add(BigInteger.valueOf(s[i] - 'a' + 10));
                            
            else if(s[i] >= '0' && s[i] <= '9') cnt = cnt.add(BigInteger.valueOf(s[i] - '0'));
                        }

                        k 
            = 0;
                        
            if(cnt.compareTo(BigInteger.ZERO) == 0{
                            System.out.println(
            "0");
                        }

                        
            else {
                            
            while(cnt.compareTo(BigInteger.ZERO) > 0{
                                
            int tp = (cnt.mod(BigInteger.valueOf(n))).intValue();
                                
            if(tp < 10) r[k] = (char)(tp + '0');
                                
            else
                                    r[k] 
            = (char)(tp + 'a' - 10);
                                
            ++k;
                                cnt 
            = cnt.divide(BigInteger.valueOf(n));
                            }

                            
            for(i = k - 1; i >= 0--i) System.out.print(r[i]);
                            System.out.println(
            "");
                        }

                    }

                }

            }
            久久只这里是精品66| av无码久久久久久不卡网站 | 香蕉久久永久视频| 久久久久久av无码免费看大片| 99久久国产免费福利| 思思久久精品在热线热| 97久久精品午夜一区二区| 亚洲伊人久久大香线蕉苏妲己| 狠狠色丁香久久婷婷综合图片| 久久精品aⅴ无码中文字字幕不卡 久久精品aⅴ无码中文字字幕重口 | 久久精品九九亚洲精品| 久久久久久国产精品美女 | 国产精品免费久久| 99久久久国产精品免费无卡顿| 理论片午午伦夜理片久久 | 国产偷久久久精品专区 | 99久久精品九九亚洲精品| 天堂久久天堂AV色综合| 久久久久久久91精品免费观看 | 日日狠狠久久偷偷色综合0| AV无码久久久久不卡蜜桃| 久久66热人妻偷产精品9| 精品久久久无码21p发布| 一本色综合网久久| 久久久国产精品亚洲一区| 久久婷婷五月综合色高清| 99久久国语露脸精品国产| 99久久久国产精品免费无卡顿| 久久AV高清无码| 久久成人18免费网站| 久久天天婷婷五月俺也去| 精品久久8x国产免费观看| 国产精品久久久久一区二区三区 | 久久久久婷婷| 国产69精品久久久久777| 欧美性大战久久久久久| 久久男人Av资源网站无码软件| 亚洲国产精品久久66| 亚洲精品乱码久久久久久自慰| 99久久亚洲综合精品网站| 久久SE精品一区二区|