SHARE
TWEET

Untitled

a guest Jan 14th, 2020 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <time.h>
  4. #include <stdlib.h>
  5.  
  6. struct dane_studentow{
  7.   char imie[20];
  8.   long pesel;
  9.   int pensja;
  10. };
  11.  
  12. void imie_studenta(struct dane_studentow student[]){
  13.   int a;
  14.    printf("\npesel krorego dziada chcesz uzyskac?");
  15.   scanf("%d",&a);
  16.   printf("\npesel to:%li",student[a].pesel);
  17. }
  18. void uzupelnij(struct dane_studentow student[]){
  19.   for(int i=1;i<4;i++){
  20.    printf("\nimie studenta %d:",i);
  21.    scanf("%s",student[i].imie);
  22.    printf("\npesel:");
  23.    scanf("%li",&student[i].pesel);
  24.    printf("\npodaj swoje zarobiki:");
  25.    scanf("%d",&student[i].pensja);
  26.  }
  27. }
  28.  
  29. void wieksza_mniejsza(struct dane_studentow student[]){
  30.   int max=0,numer;
  31.  
  32.   for(int i=1;i<4;i++){  
  33.   if(student[i].pensja>max){
  34.   max=student[i].pensja;
  35.   numer=i;
  36.   }
  37. }
  38. printf("\nnajwieksza pensja:%d nalezy do:%s",max,student[numer].imie);
  39. }
  40.  
  41. int main(){
  42.   int k;
  43.   struct dane_studentow student[100];
  44. uzupelnij(student);
  45. imie_studenta(student);
  46.  wieksza_mniejsza(student);
  47.  
  48.   return 0;
  49. }
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