Advertisement
naskedvi

S2 - zad.1

Mar 8th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. int main()
  5. {
  6. std:: cout << "Unesite broj n: ";
  7. int n;
  8. std:: cin >> n;
  9. std:: cout << "+-----+-----+-----+-----+-----+" << std::endl<< "|";
  10. for(int i=1; i<=n; i++)
  11. {
  12. std:: cout<< std::setw(4)<< i<< " |";
  13. }
  14. std:: cout<< std::endl;
  15. for(int i=2; i<=n; i++)
  16. {
  17. std:: cout << "|" <<std::setw(4)<< i<< " |";
  18. for(int j=2; j<=n; j++)
  19. {
  20. std:: cout << std::setw(4) << i*j << " |";
  21. }
  22. std:: cout << std:: endl;
  23. }
  24. std:: cout << "+-----+-----+-----+-----+-----+";
  25.  
  26. return 0;
  27. }
  28.  
  29. // ispisije kao rezultat: -inf!!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement