SHARE
TWEET

Bài 5

chinh97nd Aug 20th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int s(0), n;
  7.     float i(0);
  8.  
  9.     do
  10.     {
  11.         cout << "Nhap so nguyen duong: ";
  12.         cin >> n;
  13.         s += n;
  14.  
  15.         if (n != 0)
  16.             i++;
  17.     } while (n != 0);
  18.  
  19.     cout << "Tong day so: " << s << endl;
  20.     cout << "Trung binh cong: " << s / i << endl;
  21.    
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top