fork download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. while (true) {
  6. if (!int.TryParse(ReadLine(), out var x)) return;
  7. if (x == 0) break;
  8. if (!int.TryParse(ReadLine(), out var y)) return;
  9. if (y == 0) break;
  10. if (x > 0 && y > 0) WriteLine("primeiro");
  11. else if (x < 0 && y > 0) WriteLine("segundo");
  12. else if (x < 0 && y < 0) WriteLine("terceiro");
  13. else WriteLine("quarto");
  14. }
  15. }
  16. }
  17.  
  18. //https://pt.stackoverflow.com/q/568875/101
Success #stdin #stdout 0.02s 22280KB
stdin
1
1
1
-1
-1
1
-1
-1
0
1
stdout
primeiro
quarto
segundo
terceiro