-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.cpp
More file actions
54 lines (49 loc) · 1.14 KB
/
sample.cpp
File metadata and controls
54 lines (49 loc) · 1.14 KB
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
54
#include <iostream>
std::string test_symbolic(std::string name) {
std::string new_name = name + "newstring";
return new_name;
}
int test_arithmetic(int input) {
int a = 0xdeadbeef;
int b = 0xbeefdead;
int c = a + b;
int d = input + a;
int h = d + input;
if (d > 0xdeadbeef) {
input += 0xdead;
} else {
input -= 0xdead;
}
int e = input + b;
int f = a + b;
return f;
}
int main(int argc, char *argv[]) {
int input;
std::cin >> input;
int re = test_arithmetic(input);
/*
if (input == 10) {
std::cout << "Bingo" << std::endl;
} else {
std::cout << "incorrect" << std::endl;
}*/
std::cout << "ret" << re << std::endl;
return 0;
}
/*
int main(int argc, char *argv[]) {
std::cout << "What's your name?" << std::endl;
std::string name;
std::string name2;
std::cin >> name;
name2 = test_symbolic(name);
std::cout << "test artithemetic " << test_arithmetic() << "!" << std::endl;
if (name == "root")
std::cout << "What is your command?" << std::endl;
else
std::cout << "Hello, " << name << "!" << std::endl;
std::cout << "new string " << name2 << "!" << std::endl;
return 0;
}
*/