寄托天下
查看: 3274|回复: 1
打印 上一主题 下一主题

[技术问答] 问Java,Dynamic/Static Scoping和RSA的问题,请大家指导一下,谢谢。 [复制链接]

Rank: 2

声望
0
寄托币
56
注册时间
2006-12-9
精华
0
帖子
2
跳转到指定楼层
楼主
发表于 2007-3-16 09:35:01 |只看该作者 |倒序浏览
class Parent
                {
                    int i = 5;

                    public void printOne()
                    {   
                        System.out.println(i);
                    }

                    public void printTwo()
                    {
                        System.out.println(i);
                    }
                }

                class Child extends Parent
                {
                    int i = 6;

                    public void printOne()
                    {
                        System.out.println(i);
                    }

                    public static void main ( String args[] )
                    {
                        Parent p = new Child(); // 1
                        System.out.println ( p.i );
                        p.printOne();
                        p.printTwo();
                    }
            }

   What is the output of the above program?
            (A) 5  6  5
            (B) 5  5  5
             (C) 6  6  6
            (D) 6  5  6
            (E) 5  6  6

    The line marked //1 is replaced by the following line,
            Child p = new Child();
         What will be the output of the program?  
            (A) 6  6  5
            (B) 6  6  6
             (C) 6  5  5
            (D) 5  6  6
            (E) 5  5  6


program main ( input , output )
                var a : integer;
                var b : integer;

                procedure X;
                begin
                    if ( a>b ) then a := 2*a;
                    else b := 2*b;
                end A;

                procedure Y;
                    var a, b;
                begin
                     i := 1;
                     j := 2;
                    X;
                end Y;

            begin
                a := 25; b := 35;
                B;
                write(b);
            end;

What is the value of j output by the above program if dynamic scoping is in effect?
            (A) 35  (B) 4 (C) 70 (D) 25  (E) 8

What is the value of j output by the above program if static scoping is in effect?
            (A) 25  (B) 70  (C) 35  (D) 45 (E) 4


    In the RSA system of encryption, the public key of a given user is e=7 and two prime numbers used during encryption are p=3, q=11.  What is the generated ciphertext for a plaintext M=5?
           (A) 11  (B) 86  (C) 14  (D) 36 (E) 28



会的请指导一下,先谢谢了。
回应
0

使用道具 举报

Rank: 1

声望
0
寄托币
21
注册时间
2007-1-31
精华
0
帖子
0
沙发
发表于 2007-9-19 17:51:58 |只看该作者
最后一个选c
t=(p-1)(q-1)=20  d=7
使得 (ed)mod(t)=1
取一个 e=3
--------------------------------------------------------
e=3 n=33 M=5

密文=(5^7)mod 33=14
验证 (14^3)mod 33=5

程序自己运行一下就知道结果了,想不清楚的看书吧

使用道具 举报

RE: 问Java,Dynamic/Static Scoping和RSA的问题,请大家指导一下,谢谢。 [修改]
您需要登录后才可以回帖 登录 | 立即注册

问答
Offer
投票
面经
最新
精华
转发
转发该帖子
问Java,Dynamic/Static Scoping和RSA的问题,请大家指导一下,谢谢。
https://bbs.gter.net/thread-628724-1-1.html
复制链接
发送
报offer 祈福 爆照
回顶部