Last active
October 28, 2019 16:31
-
-
Save steveburkett/4583542 to your computer and use it in GitHub Desktop.
Given an input N, print 'hello world' N times.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int i, n; | |
cin >> n; | |
for (i=0; i<n; i++) { | |
cout << "hello world\n"; | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Solution { | |
class Solution { | |
static void Main(string[] args) { | |
var line1 = System.Console.ReadLine().Trim(); | |
var N = Int32.Parse(line1); | |
for (var i = 0; i < N; i++) { | |
System.Console.WriteLine("hello world"); | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class Solution { | |
public static void main(String args[] ) throws Exception { | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String line = br.readLine(); | |
int N = Integer.parseInt(line); | |
for (int i = 0; i < N; i++) { | |
System.out.println("hello world"); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N = int(raw_input()) | |
for i in xrange(N): | |
print "hello world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gets.to_i.times { puts "hello world" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq strN (read-line)) | |
(setq N (parse-integer strN)) | |
(loop for i from 1 to N do | |
(write "hello world") | |
(terpri) | |
) |
Given an input N, print 'hello world' N times couldn't get any better with php
echo str_repeat('hello world' N);
inpt = int(input ("Enter Number: "))
for i in range(inpt):
print("hello world")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#(dotimes [i %] (println "Hello World"))