Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- 3define N 3
- struct adress {
- char *city, *street;
- int house; };
- void fun(struct adress *);
- int main () {
- struct adress p[N]= {
- "Novosibirsk", "Lenino", 15,
- "Irkutsk", "lenino", 3,
- "novosibirsk", "Penkalskogo", 1 ,
- };
- struct adress *pc = &p;
- char *city;
- fun(pc);
- printf("vvedite city: \n");
- scanf("%c", &city);
- printf("house = %d, appartament = %d\n", home.house, home.ap);
- }
- void fun(struct adress *p,char c) {
- int i;
- for (i=0;i<N;i++)
- if (p->city==c) {
- printf(%c ")
- p->house = p->house-4;
- p->ap = p->ap-5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement