Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include "Fraction.h"
  2.  
  3. int main() {
  4.     //Du må legge til en linje her. Du velger hva som står der. Hint: Vectoren.
  5.     for (int x = 0; x < 10, x++) {
  6.         for (int y = 10; y > 0; y--) {
  7.             Fraction tmp(x, y);
  8.             fracs.push_back(tmp);
  9.         }
  10.     }
  11.     cout << fracs;
  12.     Fraction f1(1, 2);
  13.     Fraction f2(2, 9);
  14.     Fraction f3(2, 4);
  15.     if (f1 < f2) {
  16.         cout << f1 << " er minst " << endl;
  17.     }
  18.     else if (f1 == f2) {
  19.         cout << "de er like " << endl;
  20.     }
  21.     else {
  22.         cout << f2 << "er minst ";
  23.     }
  24.     if (f1 < 4) {
  25.         f1 = f1 + f2;
  26.         cout << f1 << endl;
  27.     }
  28.     f2 = f2 + 5;
  29.     cout << f2 << endl;
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement