Lgk2's blog

By Lgk2, history, 5 weeks ago, In English

https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3347

I'm trying to solve this problem in python but i'm not sure when to stop reading inputs. All inputs come in multiples of 3 but i don't know when to break my loop.

while True:
    print(pow(int(input()), int(input()), int(input())))
    input()
 
 
 
 
  • Vote: I like it
  • +4
  • Vote: I do not like it

»
5 weeks ago, # |
  Vote: I like it +18 Vote: I do not like it

I use something like this for C++

int a,b,c;

while(cin >> a >> b >> c)
    {
        cout << a << b << c;
        // work
    }
»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it
  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    hahaha nice.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Couln't realise the humour in my comment.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Nice I used it and it worked! Didn't know lack of input resulted in an EOFError.

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

such basics should be known.SPOJ will help