Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ergebnis;
- int erste = (int) (string[7]- 0x30);
- if((int) (string[8]- 0x30) >= 0 && (int) (string[8]- 0x30) <= 9) erste = (erste * 10) + (int) (string[8] - 0x30);
- if((int) (string[9]- 0x30) >= 0 && (int) (string[9]- 0x30) <= 9 && string[8] < 10) erste = (erste * 10) + (int) (string[9] - 0x30);
- int zweite = 0;
- if((int) (string[9]- 0x30) < 10 && (int) (string[8] > 10- 0x30)) zweite = (int) (string[9] - 0x30);
- if((int) (string[10]- 0x30) >= 0 && (int) (string[10]- 0x30) <= 9) zweite = (zweite * 10) + (int) (string[10] - 0x30);
- if((int) (string[11]- 0x30) >= 0 && (int) (string[11]- 0x30) <= 9) zweite = (zweite * 10) + (int) (string[11] - 0x30);
- if((char)string[8] == '+' || (char)string[9] == '+' || (char)string[10] == '+') ergebnis = erste + zweite;
- if((char)string[8] == '-' || (char)string[9] == '-' || (char)string[10] == '-') ergebnis = erste - zweite;
- if((char)string[8] == '/' || (char)string[9] == '/' || (char)string[10] == '/') ergebnis = erste / zweite;
- if((char)string[8] == '*' || (char)string[9] == '*' || (char)string[10] == '*') ergebnis = erste * zweite;
- kprintf("Das Ergebnis lautet: ");
- kputx(ergebnis, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement