Guest User

Untitled

a guest
Apr 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.77 KB | None | 0 0
  1. #include<stdio.h> /*esta é apenas a biblioteca que guarda os codigos a serem usados*/
  2.  
  3. int main (){ /*chama a função principal*/
  4. char trinca[10], trans[10], B, C;
  5. int nropcao, i=0;
  6. /*não sei se sao codons mesmo mas vou fazer a logica*/
  7. printf("ESCOLHA O NUMERO DA OPCAO QUE DESEJAR REALIZAR\n1-transcricao\n2-saber qual aminoacido correspondente\n");
  8. scanf("%d", &nropcao);
  9. while ((nropcao !=1)&&(nropcao != 2)){
  10.       printf("o sr. digitou errado, porfavor: 1 ou 2\n");
  11.       scanf("%d", &nropcao);
  12.       }
  13.     if (nropcao==1){
  14.         printf("Escreva sua trinca de ate 10 codons\n");
  15.        
  16.         scanf("%s", &trinca);
  17.        
  18.             while (trinca[i]!='\0'){
  19.                 if ((trinca[i]=='a')||(trinca[i]=='A')){
  20.                 trans[i]='u';
  21.                 }
  22.                 if ((trinca[i]=='t')||(trinca[i]=='T')){
  23.                    trans[i]='a';
  24.                 }
  25.                 if ((trinca[i]=='g')||(trinca[i]=='G')){
  26.                    trans[i]='c';
  27.                 }
  28.                 if ((trinca[i]=='c')||(trinca[i]=='C')){
  29.                    trans[i]='g';
  30.                 }
  31.                
  32.                 i++;
  33.                 }
  34.                 trans[i]='\0';
  35.                 printf("\n antiga:\n %s", trinca);
  36.                 printf("\n nova:\n %s", trans);
  37. }
  38.     if (nropcao==2){
  39.        printf("voce escolheu 2");
  40.     }
  41.  
  42. getchar();
  43. printf("\n antiga:\n %s", trinca);
  44. printf("\n nova:\n %s", trans);
  45.  
  46. getchar();
  47. getchar();
  48. return(0);
  49. }
  50. /*
  51. if(( A=='a')||( A=='t')||( A=='c')||( A=='g')||( B=='a')||( B=='c')||( B=='t')||( B=='g')||( C=='a')||( C=='t')||( C=='g')||( C=='c')){
  52. if((A=='a')&&(B=='c') &&(C=='g')){
  53. printf("essa eh a jesssiquina");
  54. }
  55. }
  56. else{
  57. printf("voce esta fazendo isso errado");
  58. }
  59.  
  60.  
  61. return(0);
  62. }
  63. */
Add Comment
Please, Sign In to add comment