29 lines
664 B
C++
29 lines
664 B
C++
#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;
|
|
}
|
|
|
|
|