Advertisement
asmodeus94

strukturaWStrukturze

Mar 26th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. struct oceny{
  4.        int sem1;
  5.        int sem2;
  6.        float sred;
  7.        };
  8. struct dziennik{
  9.        oceny polski;
  10.        oceny ang;
  11.        float sred2;
  12.        };
  13. int main(){
  14. dziennik nowaka;
  15. nowaka.polski.sem1=4;
  16. nowaka.polski.sem2=2;
  17. nowaka.polski.sred=(float)(nowaka.polski.sem1+nowaka.polski.sem2)/2;
  18. nowaka.ang.sem1=5;
  19. nowaka.ang.sem2=4;
  20. nowaka.ang.sred=(float)(nowaka.ang.sem1+nowaka.ang.sem2)/2;
  21. nowaka.sred2=(float)(nowaka.polski.sred+nowaka.ang.sred)/2;
  22. cout<<nowaka.sred2;
  23. system("pause>null");    
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement