Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int i=99;
  6. char comando[i];
  7. scanf("%s", &comando);
  8. int res = comando[0] - '0';
  9. for(i=1;i<99;i++){
  10. if(comando[i]==0){
  11. if(res>0 && res<10){
  12. printf("O comando é %d", res);}
  13. else
  14. printf("é um char");
  15. i=99;}
  16. else {
  17. i=99;
  18. printf("ERRO");
  19. }}
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement