Advertisement
gashink_t

dont

Feb 13th, 2020
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. 3define N 3
  5. struct adress {
  6. char *city, *street;
  7. int house; };
  8.  
  9. void fun(struct adress *);
  10.  
  11. int main () {
  12. struct adress p[N]= {
  13. "Novosibirsk", "Lenino", 15,
  14. "Irkutsk", "lenino", 3,
  15. "novosibirsk", "Penkalskogo", 1 ,
  16. };
  17. struct adress *pc = &p;
  18. char *city;
  19. fun(pc);
  20. printf("vvedite city: \n");
  21. scanf("%c", &city);
  22.  
  23. printf("house = %d, appartament = %d\n", home.house, home.ap);
  24.  
  25. }
  26.  
  27. void fun(struct adress *p,char c) {
  28. int i;
  29. for (i=0;i<N;i++)
  30. if (p->city==c) {
  31. printf(%c ")
  32. p->house = p->house-4;
  33. p->ap = p->ap-5;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement