30 成绩的柱状图

30 成绩的柱状图

 

#include <stdio.h>
main()
{
    int i,x,n,j;
    char s[9];
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%s%d",s,&x);
        printf("%8s |",s);
        for(j=0;j<x;j++)
            printf("=");
        printf("\n");
    }
}

错误点:输入的字符不是数组时候会无法运行

 

转载于:https://www.cnblogs.com/zoti007/articles/10002599.html

相关文章:

  • 2021-04-21
  • 2021-12-25
  • 2022-12-23
  • 2021-07-17
  • 2021-08-21
猜你喜欢
  • 2022-02-27
  • 2022-12-23
  • 2021-04-07
  • 2022-03-01
  • 2021-07-15
  • 2021-06-20
  • 2022-12-23
相关资源
相似解决方案