Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<time.h>
- int main(int argc,char *argv[])
- {
- int N, G, i, count1, count2, ans[99], gue[99];
- N = atoi(argv[1]);
- G = atoi(argv[2]);
- printf("Please enter the answer you want.\n");
- printf("You can only enter one number each time.\n");
- for(i = 0; i < N; i++) {
- scanf("%d", &ans[i]);
- }
- printf("Now input the number you want to guess.\n");
- printf("You can only enter one number each time.\nSTART!!\n");
- for(i = 0; i < N; i++) {
- scanf("%d", &gue[i]);
- }
- count1 = 0;
- for(i = 0; i < N; i++) {
- while(ans[i] == gue[i]) {
- ++count1;
- }
- }
- count2 = 1;
- printf("%dH,%dX", count1, count2);
- system("pause");
- }
Add Comment
Please, Sign In to add comment