-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHello.cpp
More file actions
47 lines (37 loc) · 1.03 KB
/
Hello.cpp
File metadata and controls
47 lines (37 loc) · 1.03 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
#include <iostream>
#include <fstream>
#include <math.h>
#include <map>
#include <string>
bool isPrime(const int &);
int * primeArray(const int &);
int main(){
int a,b;
std::map<std::string, int> test;
test["ewb72506"] = 32;
std::cout << test["ewc72506"] << std::endl;
std::ofstream ofile;
std::ifstream ifile;
ofile.open ("path/to/file.txt");
for(int i(1); i <= 20; ++i) {
if(isPrime(i))
std::cout << i << " is a prime\n";
}
std::cout << "This is the line number " << __LINE__;
std::cout << " of file " << __FILE__ << ".\n";
std::cout << "Its compilation began " << __DATE__;
std::cout << " at " << __TIME__ << ".\n";
std::cout << "The compiler gives a __cplusplus value of " << __cplusplus << std::endl;
return 0;
}
bool isPrime(const int &num) {
for(int i(2); i < sqrt(num); ++i)
if( num%i == 0)
return false;
return true;
}
int * primeArray(const int &maxNum) {
int * primes;
primes = new int[10];
return primes;
}