Guest User

Untitled

a guest
Feb 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<time.h>
  4.  
  5. int main(int argc,char *argv[])
  6. {
  7. int N, G, i, count1, count2, ans[99], gue[99];
  8.  
  9. N = atoi(argv[1]);
  10. G = atoi(argv[2]);
  11.  
  12. printf("Please enter the answer you want.\n");
  13. printf("You can only enter one number each time.\n");
  14.  
  15. for(i = 0; i < N; i++) {
  16. scanf("%d", &ans[i]);
  17. }
  18.  
  19. printf("Now input the number you want to guess.\n");
  20. printf("You can only enter one number each time.\nSTART!!\n");
  21.  
  22. for(i = 0; i < N; i++) {
  23. scanf("%d", &gue[i]);
  24. }
  25.  
  26. count1 = 0;
  27.  
  28. for(i = 0; i < N; i++) {
  29. while(ans[i] == gue[i]) {
  30. ++count1;
  31. }
  32. }
  33.  
  34. count2 = 1;
  35.  
  36. printf("%dH,%dX", count1, count2);
  37.  
  38. system("pause");
  39. }
Add Comment
Please, Sign In to add comment