avukas

Untitled

Mar 1st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4.  
  5. int main()
  6. {
  7.  
  8. for (int i(1); i<=104; i++)
  9. {
  10. for (int j(1); j<=33; j++)
  11. {
  12. if (i==1 || i==3 || i==104)
  13. {
  14. if (j==1 || j==11 || j==2|| j==33)
  15.  
  16. std::cout<<"+";
  17. else
  18. std::cout <<"-";
  19.  
  20. }
  21. if (((i==2) || (i>=4 && i<=103)) && (j == 1 || j == 11 || j == 22 || j == 33)) std::cout << "|";
  22.  
  23. if (i == 2)
  24. {
  25. if (j==2) std::cout<<" Brojevi ";
  26. if (j==12) std::cout<<" Kvadrati ";
  27. if(j==23) std::cout<<" Korijeni ";
  28. }
  29.  
  30. if (i>=4 && i<=103)
  31. {
  32. if (j == 2) std::cout << " " << std::left << std::setw(8)<< i - 3 ;
  33. if (j == 12) std::cout << std::right << std::setw(9) << pow(i - 3 , 2 ) <<" ";
  34. std::cout.precision(4);
  35. if (j == 23) std::cout << std::right << std::setw(9) << sqrt( i - 3 ) << " ";
  36. std::cout.precision(4);
  37. }
  38.  
  39. }
  40. std::cout<< std::endl;
  41. }
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment