Algorithm
Problem Name: beecrowd | 2581
Problem Link: https://www.beecrowd.com.br/judge/en/problems/view/2581
I am Toorg!
By Ricardo Martins, IFSULDEMINAS Brazil
Timelimit: 1
Toorg is the wisest member of the group of heroes called The Protectors of the Milky Way. For any question, it has the ideal answer! Write a program that, given a question, tells Toorg's answer.
Input
The input will have several test cases. For each test case, a N number is displayed, which represents the number of test cases. Then there will be N lines, with questions asked for Toorg.
Output
For each test case, print Toorg's answer.
Input Sample | Output Sample |
3 |
I am Toorg! |
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int i, j, n;
char str[501], ch;
scanf("%i", &n);
for (i = 0; i < n; ++i)
{
fflush(stdin);
fgets(str, 501, stdin);
printf("I am Toorg!\n");
}
return 0;
}
Copy The Code &
Try With Live Editor
Input
Output
#2 Code Example with C++ Programming
Code -
C++ Programming
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for(int i = 0; i < n ; i++){
cin.ignore();
string s;
getline(cin , s);
cout << "I am Toorg!\n";
}
return 0;
}
Copy The Code &
Try With Live Editor
Input
Output
#3 Code Example with Javascript Programming
Code -
Javascript Programming
const { readFileSync } = require("fs")
const [N] = readFileSync("/dev/stdin", "utf8").split("\n")
const DEFAULT_RESP = "I am Toorg!"
for (let i = Number.parseInt(N, 10); i > 0; i--) console.log(DEFAULT_RESP)
Copy The Code &
Try With Live Editor
Input
Output
#4 Code Example with Python Programming
Code -
Python Programming
n = int(input())
for i in range(0, n):
input()
print("I am Toorg!")
Copy The Code &
Try With Live Editor
Input
Output
#5 Code Example with Java Programming
Code -
Java Programming
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
int number;
number=sc.nextInt();
sc.next();
while(number > 0){
String id1;
id1=sc.nextLine();
number--;
System.out.println("I am Toorg!");
}
}
}
}
Copy The Code &
Try With Live Editor
Input
Output