Guest User

Untitled

a guest
Apr 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.36 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], ABC[3];
  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.                 if ((trinca[i]!='a')&&(trinca[i]!='A')&&(trinca[i]!='t')&&(trinca[i]!='T')&&(trinca[i]!='g')&&(trinca[i]!='G')&&(trinca[i]!='c')&&(trinca[i]!='C')){
  32.                      trans[i]='?';
  33.                      }
  34.                 i++;
  35.                 }
  36.                 trans[i]='\0';
  37.                 printf("\n antiga:\n %s", trinca);
  38.                 printf("\n nova:\n %s", trans);
  39. }
  40.     if (nropcao==2){
  41.        printf("digite as tres letras do codon em maiusculo\n");
  42.        scanf("%s", &ABC);
  43.             if ((ABC=='UUU')||(ABC=='UUC')){
  44.             printf("Fenialanina (Fen)");
  45.             }
  46.             if ((ABC=='UUA')||(ABC=='UUG')||(ABC=='CUU')||(ABC=='CUC')||(ABC=='CUA')||(ABC=='CUG')){
  47.             printf("Leucina (Leu)");
  48.             }
  49.             if ((ABC=='AUU')||(ABC=='AUC')||(ABC=='AUA')){
  50.             printf("Isoleucina (Ile)");
  51.             }
  52.             if (ABC=='AUG') {
  53.             printf("Metionina (Met) - Codon de inicio");
  54.             }
  55.             if ((ABC=='GUU')||(ABC=='GUC')||(ABC=='GUA')||(ABC=='GUG')){
  56.             printf("Valina (Val)");
  57.             }
  58.             if ((ABC=='UCU')||(ABC=='UCC')||(ABC=='UCA')||(ABC=='UCG')||(ABC=='AGU')||(ABC=='ACG')){
  59.             printf("Serina (Ser)");
  60.             }
  61.             if ((ABC=='CCU')||(ABC=='CCC')||(ABC=='CCA')||(ABC=='CCG')){
  62.             printf("Prolina (Pro)");
  63.             }
  64.             if ((ABC=='ACU')||(ABC=='ACC')||(ABC=='ACA')||(ABC=='ACG')){
  65.             printf("Treonina (Tre)");
  66.             }
  67.             if ((ABC=='GCU')||(ABC=='GCC')||(ABC=='GCA')||(ABC=='GCG')){
  68.             printf("Alanina (Ala)");
  69.             }
  70.             if ((ABC=='UAU')||(ABC=='UAC')){
  71.             printf("Tirosina (Tir)");
  72.             }
  73.             if ((ABC=='CAU')||(ABC=='CAC')){
  74.             printf("Histidina (His)");
  75.             }
  76.             if ((ABC=='CAA')||(ABC=='CAG')){
  77.             printf("Glutamina (Glu)");
  78.             }
  79.             if ((ABC=='AUU')||(ABC=='AAC')){
  80.             printf("Asparagina (Asn)");
  81.             }
  82.             if ((ABC=='AAA')||(ABC=='AAG')){
  83.             printf("Lisina (Lis)");
  84.             }
  85.             if ((ABC=='GAU')||(ABC=='GAC')){
  86.             printf("Aspartato (Asp)");
  87.             }
  88.             if ((ABC=='GAA')||(ABC=='GAG')){
  89.             printf("Glutamato (Glu)");
  90.             }
  91.             if ((ABC=='UGU')||(ABC=='UGC')){
  92.             printf("Cisteina (Cis)");
  93.             }
  94.             if (ABC=='UGG'){
  95.             printf("Triptofano (Trp)");
  96.             }
  97.             if ((ABC=='CGU')||(ABC=='CGC')||(ABC=='CGA')||(ABC=='CGG')||(ABC=='AGA')||(ABC=='AGG')){
  98.             printf("Arginina (Arg)");
  99.             }
  100.             if ((ABC=='GGU')||(ABC=='GGC')||(ABC=='GGA')||(ABC=='GGG')){
  101.             printf("Glicina (Gli)");
  102.             }
  103.             if ((ABC=='UAA')||(ABC=='UAG')||(ABC=='UGA')){
  104.             printf("Codon de parada, nao ha aminoacido correspondente");
  105.             }
  106.             }
  107.  
  108.  
  109.  
  110. getchar();
  111. getchar();
  112. return(0);
  113. }
  114. /*
  115. 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')){
  116. if((A=='a')&&(B=='c') &&(C=='g')){
  117. printf("essa eh a jesssiquina");
  118. }
  119. }
  120. else{
  121. printf("voce esta fazendo isso errado");
  122. }
  123.  
  124.  
  125. return(0);
  126. }
  127. */
Add Comment
Please, Sign In to add comment