#include <stdio.h>
#include <ctype.h>
int main( ) {
char texto[ 30 ] ;
printf ( "Pressione A B C para 2" ) ; printf ( "\n Pressione D E F para 3" ) ; printf ( "\n Pressione G H I para 4" ) ; printf ( "\n Pressione J K L para 5" ) ; printf ( "\n Pressione M N O para 6" ) ; printf ( "\n Pressione P Q R S para 7" ) ; printf ( "\n Pressione T U V para 8" ) ; printf ( "\n Pressione W X Y Z para 9" ) ; printf ( "\n \n Informe as letras: " ) ; for ( int i = 0 ; texto[ i] != '\0 ' ; i++ ) {
if ( letra
== 'A' || texto
[ i
] == 'B' || letra
== 'C' ) printf ( "2" ) ; else if ( letra
== 'D' || letra
== 'E' || letra
== 'F' ) printf ( "3" ) ; else if ( letra
== 'G' || letra
== 'H' || letra
== 'I' ) printf ( "4" ) ; else if ( letra
== 'J' || letra
== 'K' || letra
== 'L' ) printf ( "5" ) ; else if ( letra
== 'M' || letra
== 'N' || letra
== 'O' ) printf ( "6" ) ; else if ( letra
== 'P' || letra
== 'Q' || letra
== 'R' || letra
== 'S' ) printf ( "7" ) ; else if ( letra
== 'T' || letra
== 'U' || letra
== 'V' ) printf ( "8" ) ; else if ( letra
== 'W' || letra
== 'X' || letra
== 'Y' || letra
== 'Z' ) printf ( "9" ) ; }
}
//https://pt.stackoverflow.com/q/341033/101
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjdHlwZS5oPgoKaW50IG1haW4oKXsKICAgIGNoYXIgdGV4dG9bMzBdOwogICAgcHJpbnRmKCJQcmVzc2lvbmUgQSBCIEMgcGFyYSAyIik7CiAgICBwcmludGYoIlxuUHJlc3Npb25lIEQgRSBGIHBhcmEgMyIpOwogICAgcHJpbnRmKCJcblByZXNzaW9uZSBHIEggSSBwYXJhIDQiKTsKICAgIHByaW50ZigiXG5QcmVzc2lvbmUgSiBLIEwgcGFyYSA1Iik7CiAgICBwcmludGYoIlxuUHJlc3Npb25lIE0gTiBPIHBhcmEgNiIpOwogICAgcHJpbnRmKCJcblByZ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