Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- // Перевод строки в число '1234'(char[]) = 1234(int)
- char c[100];
- gets(c);
- int result = 0;
- for (int i = 0; i < strlen(c); i++){
- result = result * 10 + (c[i] - '0');
- }
- printf("%i", result);
- return 0;
- }
Add Comment
Please, Sign In to add comment