-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello.py
53 lines (43 loc) · 789 Bytes
/
hello.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from programlib import Program
hw = """
#include <vector>
#include <iostream>
#include <string>
#include <cstring>
#include <queue>
#include <stdio.h>
#include <math.h>
#include <map>
#include <set>
#include <stack>
#include <climits>
using namespace std;
/*
A program that outputs "Hello World"
For example,
input:
output:
Hello World
*/
int main() {
cout << "Hello World!" << endl;
return 0;
}
"""
program = Program(hw, language='C++')
tests = program.test([
([], ['Hello World!'])
])
print(tests)
hw = hw.replace('World', 'Earth')
program = Program(hw, language='C++')
tests = program.test([
([], ['Hello World!'])
])
print(tests)
hw = hw.replace(';', '!')
program = Program(hw, language='C++')
tests = program.test([
([], ['Hello World!'])
])
print(tests)