Advertisement
sellmmaahh

tut1-zad3

Jul 20th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4.  
  5. int main ()
  6. {
  7.     std::cout<<"+---------+----------+----------+"<<std::endl;
  8.     std::cout<<"| Brojevi | Kvadrati | Korijeni |"<<std::endl;
  9.     std::cout<<"+---------+----------+----------+"<<std::endl;
  10.     for (int i=1; i<=100; i++) {
  11.         std::cout<<"| "<<std::left<<std::setw(8)<<i<<"|"<<std::right<<std::setw(9)<<i*i<<" "<<"|"<<std::setw(9)<<std::fixed<<std::setprecision(3)<<sqrt(i)<<" "<<"|"<<std::endl;
  12.  
  13.     }
  14.      std::cout<<"+---------+----------+----------+"<<std::endl;
  15.      return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement