Regiane Posted September 5, 2021 at 12:13 AM Report Share #623606 Posted September 5, 2021 at 12:13 AM vocês conhecem algum conversor da linguagem c para Python? sei que são bem semelhantes, porém não estou compreendendo como fazer alterações para transforma-lo. por favor, se alguém conseguir me ajudar, eu agradeço 💕 #include <iostream> #include <string.h> int main (){ int i; char telefone[20]; char ch; i=0 while((ch=getchar ())) 1='\n') ( if (ch=='-')telefone[1]='-'; else if (ch >=48 && ch <=57) telefone [i]=ch; else if (ch >=65 && ch <=67) telefone [i]='2'; else if (ch >=68 && ch <=70) telefone [i]='3'; else if (ch >=71 && ch <=73) telefone [i]='4'; else if (ch >=74 && ch <=76) telefone [i]='5'; else if (ch >=77 && ch <=79) telefone [i]='6'; else if (ch >=80 && ch <=83) telefone [i]='7'; else if (ch >=84 && ch <=86) telefone [i]='8'; else if (ch >=87 && ch <=90) telefone [i]='9'; i++; } telefone[i]='\0'; printf("%s", telefone); return(0); } Link to comment Share on other sites More sharing options...
iron Posted September 5, 2021 at 12:47 AM Report Share #623607 Posted September 5, 2021 at 12:47 AM Tens aqui a solução: https://www.portugal-a-programar.pt/forums/topic/79145-como-esse-programa-ficaria-em-python/?tab=comments#comment-623605 Lê bem os comentários que a solução está lá 😉 1 Report Cumprimentos, iron Link to comment Share on other sites More sharing options...
Regiane Posted September 5, 2021 at 12:55 AM Author Report Share #623608 Posted September 5, 2021 at 12:55 AM 7 minutos atrás, iron disse: Tens aqui a solução: https://www.portugal-a-programar.pt/forums/topic/79145-como-esse-programa-ficaria-em-python/?tab=comments#comment-623605 Lê bem os comentários que a solução está lá 😉 oi, eu vi esse post tb e infelizmente tá em inglês o livro de python, vocês poderiam me ajudar? Link to comment Share on other sites More sharing options...
Recommended Posts