Page 1 of 1

solving problems on online judges

Posted: Sat Jul 26, 2014 12:28 pm
by zinayel
I am a first year CS student, I learned C language very well and i was thinking about starting solving problems on online judges like UVa but i can't understand the questions and sample inputs and outputs, i haven't taken any algorithm courses at college though i have some small background, how can i start ?
_________________
island places to visit ~ things to do in au ~ history of automobiles

Re: solving problems on online judges

Posted: Sat Jul 26, 2014 6:33 pm
by lighted
I can give you example. Problem 11172.
http://uva.onlinejudge.org/index.php?op ... oblem=2113

Your program must read from standart input and write to standart output. (When you write input data in cmd (for example) and program writes results there).
Don't read and write to files.

This is code

Code: Select all

#include <stdio.h>

int main() {

  int a, b, t;

  scanf("%d", &t);

  while (t--) 
  {
    scanf("%d %d", &a, &b);

    if (a == b)  puts("=");
    if (a < b)   puts("<");
    if (a > b)   puts(">");
  }

  return 0;
}
You can submit here
http://uva.onlinejudge.org/index.php?op ... D+13949950

You can select any of C/C++ languages.