repl.it
@SharkFin/

Doing some tests

C++

No description

fork
loading
Files
  • main.cpp
main.cpp
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
#include <iostream>
#include <vector>
#include <string>

class test {
public:
	static int addNums(int a, int b) {
		return a + b;
	}
};

int main() {
	static const int arr[] = {1,2,3,4,5,6,7,8,9};
	static const int arr2[] = {10,11,12,13,14,15};
	
	std::vector<int> vec(arr, arr + sizeof(arr) / sizeof(int));

	for(int i=0;i<vec.size();i++) {
		std::cout << vec[i];
		i < vec.size()-1 ? std::cout << '-' : std::cout << std::endl;
	}

	std::cout << test::addNums(1173, 438) << std::endl;

	std::cout << "Hey how are you? ";
	std::string answer;
	std::getline(std::cin, answer);
	std::cout << "That's " << answer << std::endl;

	return 1;
}
?