Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main (){
  6. int xronia,sum=0,num_anerg650=0,epidoma=0,num_anerg10=0,i=0;;
  7. string name;
  8. float mo=0.0;
  9.  
  10. do {
  11. cout<<"Dwse name: ";
  12. cin>>name;
  13. cout<<"Dwse xronia: ";
  14. cin>>xronia;
  15. if (xronia<10){
  16. epidoma=xronia*100;
  17. }
  18. else{
  19. epidoma=xronia*130;
  20. num_anerg650++;
  21. }
  22.  
  23. sum=sum+epidoma;
  24. if (epidoma>650)
  25. num_anerg10++;
  26.  
  27. i++;
  28.  
  29. }while (name!="END");
  30.  
  31. mo=sum/i;
  32. cout<<"Mesos oros:"<<mo<<endl;
  33. cout<<"Arithmos anergwn me epidoma > 650$:"<<num_anerg650<<endl;
  34. cout<<"Arithmos anergwn pou doulepsan panw apo 10 xronia:"<<num_anerg10<<endl;
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement