#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int a,b,c,d,x,y,z,z1; scanf("%d",&a); scanf("%d",&b); scanf("%ld",&z); printf("%d*x %d*y=%d",a,b,z); printf("\n"); scanf("%d",&c); scanf("%d",&d); scanf("%ld",&z1); printf("%d*x %d*y=%d",a,b,z1); printf("\n"); for(x=-1000;x<=1000;x++) { for(y=-1000;y<=1000;y++) { if((a*x+b*y==z)&&(c*x+d*y==z1)) { printf("x=%d,y=%d",x,y); printf("\n"); } } } return 0; }
|
|