consolidate all repos to one for archive
This commit is contained in:
28
semester_2/programiranje_2/primeri/Example33/main.cpp
Normal file
28
semester_2/programiranje_2/primeri/Example33/main.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
|
||||
int main() {
|
||||
int n=10;
|
||||
std::cout << std::hex << n << std::endl;
|
||||
std::cout << std::dec << n << std::endl;
|
||||
std::cout.operator<<(std::dec).operator<<(n).operator<<(std::endl);
|
||||
|
||||
std::ofstream output("square.txt", std::ios::out);
|
||||
output<<" N | Square"<<std::endl;
|
||||
output<<"------------"<<std::endl;
|
||||
for (int i=1; i<=n; i++) {
|
||||
output << i;
|
||||
output << i*i;
|
||||
/*
|
||||
output << std::setfill(' ');
|
||||
output << std::setw(2) << i;
|
||||
output << std::setw(5) << i*i;
|
||||
*/
|
||||
output << std::endl;
|
||||
}
|
||||
output.close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user