Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. /*
  2. * test.c
  3. *
  4. * Created on: Dec 12, 2019
  5. * Author: cdamian
  6. saallzzooocct
  7. CNP = 1980606123456
  8. = 5061106123456
  9. 0123456789012
  10. lunaNasterii = cnp[3] * 10 + cnp[4]
  11.  
  12.  
  13. 1
  14. 2631
  15. 8426 8421
  16. ---- ----
  17. 7654 3210__
  18. baza 10: 45 4554 = 400000 + 5 * 10000 +
  19. baza 2:0010 0010 = 0 * x + 32 + 2 = 34
  20. 0110 0100 = 64 + 32 + 4 = 100
  21. 0110 0110 = 102
  22.  
  23. */
  24.  
  25. #include<stdio.h>
  26. int main(){
  27. // char c = 100; // 110 0100 - 100 - 'd'
  28. // c = 'f'; // 110 0110 - 102 - 'f'
  29. //
  30. // char test = c + 2; // test = 104 = 'h'
  31. //
  32. // printf("%c - %d - %x\n", test, test, test);
  33. //
  34. //
  35. // char test1 = 0; //
  36. // char test2 = '0'; //
  37. //
  38. //
  39. // int n1 = test1 * 7;
  40. // int n2 = test2 * 7;
  41. //
  42. // printf("%d %d\n", n1, n2);
  43.  
  44.  
  45. /*
  46. * a. 0 0
  47. * b. 0 7
  48. * c. 7 0
  49. * d. 336 0
  50. * e. 0 336
  51. * f. 00000000 '0''0''0''0''0''0''0''0'
  52. * g.
  53. *
  54. */
  55.  
  56.  
  57. char cnp[14];
  58. char cnp2[] = "1981206123456";
  59. int lunaNasterii;
  60.  
  61.  
  62. // printf("Dati CNP: ");
  63. // scanf("%s", cnp);
  64.  
  65.  
  66.  
  67.  
  68. lunaNasterii = (cnp2[3] - '0') * 10 + cnp2[4] - '0';
  69.  
  70. printf("luna nasterii: %d\n", lunaNasterii);
  71.  
  72.  
  73.  
  74.  
  75.  
  76. return 0;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement