Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int random(int min, int max){
- return min + rand() / (RAND_MAX / (max - min + 1) + 1);
- }
- int main()
- {
- srand( time( NULL ) );
- int x,y;
- int tempX,tempY;
- x = random(3,7);
- y = random(-4,2);
- for (int i = 0; i < 4; i++){
- printf("Enter x: \n");
- scanf("%d", &tempX);
- printf("Enter y: \n");
- scanf("%d", &tempY);
- if(x == tempX){
- printf("Ti ugadal x!\n");
- } else if(tempX > x){
- printf("umench x\n");
- } else {
- printf("uvelich x\n");
- }
- if(y == tempY){
- printf("Ti ugadal y!\n");
- } else if(tempY > y){
- printf("umench y\n");
- } else {
- printf("uvelich y\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement