| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 460 人关注过本帖
标题:求帮助出错??
只看楼主 加入收藏
zhaoyangzero
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2013-11-6
结帖率:0
收藏
已结贴  问题点数:20 回复次数:8 
求帮助出错??
#include<stdio.h>
int fu(char i);
int main()
{
    char s[64]={0}, b[64][10]={"苯丙氨酸","苯丙氨酸","亮氨酸","亮氨酸","丝氨酸","丝氨酸","丝氨酸","丝氨酸","酪氨酸","酪氨酸","终止密码子","终止密码子","半胱氨酸","半胱氨酸","终止密码子","色氨酸","亮氨酸","亮氨酸","亮氨酸","亮氨酸","脯氨酸","脯氨酸","脯氨酸","脯氨酸","组氨酸","组氨酸","谷氨酰胺","谷氨酰胺","精氨酸","精氨酸","精氨酸","精氨酸","异亮氨酸","异亮氨酸","异亮氨酸","甲硫氨酸","苏氨酸","苏氨酸","苏氨酸","苏氨酸","天冬酰胺","天冬酰胺","赖氨酸","赖氨酸","丝氨酸","丝氨酸","精氨酸","精氨酸","缬氨酸","缬氨酸","缬氨酸","缬氨酸","丙氨酸","丙氨酸","丙氨酸","丙氨酸","天冬氨酸","天冬氨酸","谷氨酸","谷氨酸","甘氨酸","甘氨酸","甘氨酸","甘氨酸"};
    int a,n[64],sum;
    printf("请输入DNA单链序列: \n");
    scanf("%s",&s);
    printf("\n输入的DNA序列为:");
    for(a=0;s[a]!=0;a++)
    {
        printf("-");
        printf("%c",s[a]);
    }
     printf("-");
     printf("\n对应的DNA单链为:");
     for (a=0;s[a]!=0;a++)
     {
         printf("-");
         switch(s[a])
         {
             case 'A':printf("T");break;
             case 'G':printf("C");break;
             case 'T':printf("A");break;
             case 'C':printf("G");break;
             default :printf(" ");break;
         }
     }
     printf("-");
     printf("\n转录生成的M-RNA为:");
     for (a=0;s[a]!=0;a++)
     {
         printf("-");
         switch(s[a])
         {
             case 'A':printf("U");break;
             case 'G':printf("C");break;
             case 'T':printf("A");break;
             case 'C':printf("G");break;
             default :printf(" ");break;
         }
     }
     printf("-");
     printf("\n翻译合成的蛋白质的氨基酸序列为:\n");
     for (a=0;n[a-1]!=1000;a++)
     {
        n[a] = fu(s[a]);
     }
     for (a=0;n[a-1]!=1000;a+=3)
     {
         printf("-");
         sum=n[a]*16+n[a+1]*4+n[a+2];
         printf("%s",b[sum]);
     }
     return 0;
}
int fu(char i)
{
  int j;
  switch(i)
  {
    case 'A':j=0;break;
    case 'G':j=1;break;
    case 'T':j=2;break;
    case 'C':j=3;break;
    default :j=1000;break;
  }
  return j;
}
运行完一直不能read 谁能告诉我我哪里错了啊??
搜索更多相关主题的帖子: 半胱氨酸 苯丙氨酸 include 精氨酸 赖氨酸 
2013-11-06 11:21
逆风而前
Rank: 7Rank: 7Rank: 7
来 自:福建
等 级:黑侠
威 望:7
帖 子:193
专家分:567
注 册:2013-2-14
收藏
得分:10 
有没有什么测试的数据写出来一下,好在改完后测试一下
2013-11-06 11:33
逆风而前
Rank: 7Rank: 7Rank: 7
来 自:福建
等 级:黑侠
威 望:7
帖 子:193
专家分:567
注 册:2013-2-14
收藏
得分:0 
#include<stdio.h>
int fu(char i);
int main()
{
    char s[64]={0}, b[64][14]={"苯丙氨酸","苯丙氨酸","亮氨酸","亮氨酸","丝氨酸","丝氨酸","丝氨酸",
        "丝氨酸","酪氨酸","酪氨酸","终止密码子","终止密码子","半胱氨酸","半胱氨酸","终止密码子","色氨酸",
        "亮氨酸","亮氨酸","亮氨酸","亮氨酸","脯氨酸","脯氨酸","脯氨酸","脯氨酸","组氨酸","组氨酸",
        "谷氨酰胺","谷氨酰胺","精氨酸","精氨酸","精氨酸","精氨酸","异亮氨酸","异亮氨酸","异亮氨酸","甲硫氨酸",
        "苏氨酸","苏氨酸","苏氨酸","苏氨酸","天冬酰胺","天冬酰胺","赖氨酸","赖氨酸",
        "丝氨酸","丝氨酸","精氨酸","精氨酸","缬氨酸","缬氨酸","缬氨酸","缬氨酸","丙氨酸",
        "丙氨酸","丙氨酸","丙氨酸","天冬氨酸","天冬氨酸","谷氨酸","谷氨酸","甘氨酸","甘氨酸","甘氨酸","甘氨酸"};
    int a,n[64],sum;
    printf("请输入DNA单链序列: \n");
    scanf("%s",&s);
    printf("\n输入的DNA序列为:");
    for(a=0;s[a]!='\0';a++)
    {
        printf("-");
        printf("%c",s[a]);
    }
     printf("-");
     printf("\n对应的DNA单链为:");
     for (a=0;s[a]!='\0';a++)
     {
         printf("-");
         switch(s[a])
         {
             case 'A':printf("T");break;
             case 'G':printf("C");break;
             case 'T':printf("A");break;
             case 'C':printf("G");break;
             default :printf(" ");break;
         }
     }
     printf("-");
     printf("\n转录生成的M-RNA为:");
     for (a=0;s[a]!='\0';a++)
     {
         printf("-");
         switch(s[a])
         {
             case 'A':printf("U");break;
             case 'G':printf("C");break;
             case 'T':printf("A");break;
             case 'C':printf("G");break;
             default :printf(" ");break;
         }
     }
     printf("-");
     printf("\n翻译合成的蛋白质的氨基酸序列为:\n");
     for (a=0;n[a]!=1000;a++)
     {
        n[a] = fu(s[a]);
     }
     for (a=0;n[a]!=1000;a+=3)
     {
         printf("-");
         sum=n[a]*16+n[a+1]*4+n[a+2];
         printf("%s",b[sum]);
     }
     return 0;
}
int fu(char i)
{
  int j;
  switch(i)
  {
    case 'A':j=0;break;
    case 'G':j=1;break;
    case 'T':j=2;break;
    case 'C':j=3;break;
    default :j=1000;break;
  }
  return j;
}
2013-11-06 11:49
yuccn
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:何方
等 级:版主
威 望:167
帖 子:6815
专家分:42393
注 册:2010-12-16
收藏
得分:10 
帮助出错。呵呵

我行我乐
公众号:逻辑客栈
我的博客:
https://blog.yuccn. net
2013-11-06 11:50
逆风而前
Rank: 7Rank: 7Rank: 7
来 自:福建
等 级:黑侠
威 望:7
帖 子:193
专家分:567
注 册:2013-2-14
收藏
得分:0 
你输入的ATGCTAAC   的个数应该是3的倍数.不然会出错.
b[64][14] 红色部分应该改成大于10的数字.
上面还没改完全
2013-11-06 11:53
zhaoyangzero
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2013-11-6
收藏
得分:0 
回复 4楼 yuccn
…失误失误……
2013-11-06 12:30
zhaoyangzero
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2013-11-6
收藏
得分:0 
回复 6楼 zhaoyangzero
奥 嗦嘎 谢谢哈
2013-11-06 12:31
逆风而前
Rank: 7Rank: 7Rank: 7
来 自:福建
等 级:黑侠
威 望:7
帖 子:193
专家分:567
注 册:2013-2-14
收藏
得分:0 
回复 4楼 yuccn
你帮帮他改一改吧
2013-11-06 12:46
zhaoyangzero
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2013-11-6
收藏
得分:0 
改完之后显示  “Ox77c12a16”指令引用的“OxO7ebddd8”内存。该内存不能为“read”。 这是怎么回事啊???
2013-11-06 18:45
快速回复:求帮助出错??
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021209 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved