博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
接受5门科目成绩并输出平均成绩的C程序
阅读量:2507 次
发布时间:2019-05-11

本文共 830 字,大约阅读时间需要 2 分钟。

#include<stdio.h>
#include<conio.h>

void main()
{


int a,b,c,d,e,average;
clrscr();

printf(“Enter marks of subject 1:”);
scanf(“%d”,&a);
printf(“Enter marks of subject 2:”);
scanf(“%d”,&b);
printf(“Enter marks of subject 3:”);
scanf(“%d”,&c);
printf(“Enter marks of subject 4:”);
scanf(“%d”,&d);
printf(“Enter marks of subject 5:”);
scanf(“%d”,&e);

average=(a+b+c+d+e)/5;
printf(“nAverage=%d”,average);
getch();
}

#include<stdio.h>
#include<conio.h>

void main()
{


int a,b,c,d,e,average;
clrscr();

printf(“Enter marks of subject 1:”);
scanf(“%d”,&a);
printf(“Enter marks of subject 2:”);
scanf(“%d”,&b);
printf(“Enter marks of subject 3:”);
scanf(“%d”,&c);
printf(“Enter marks of subject 4:”);
scanf(“%d”,&d);
printf(“Enter marks of subject 5:”);
scanf(“%d”,&e);

average=(a+b+c+d+e)/5;
printf(“nAverage=%d”,average);
getch();
}

翻译自:

转载地址:http://hrwwd.baihongyu.com/

你可能感兴趣的文章
查找后去掉EditTextView的焦点
查看>>
springMVC中一个class中的多个方法
查看>>
Linux系统安装出错后出现grub rescue的修复方法
查看>>
线段树模板整理
查看>>
[教程][6月4日更新]VMware 8.02虚拟机安装MAC lion 10.7.3教程 附送原版提取镜像InstallESD.iso!...
查看>>
Guava之FluentIterable使用示例
查看>>
[iOS问题归总]iPhone上传项目遇到的问题
查看>>
软件包管理:rpm命令管理-包命名与依赖性
查看>>
iOS之瀑布流布局设计
查看>>
eclipse---常用快捷键
查看>>
位置服务成为新经济亮点
查看>>
Python天天美味(总) --转
查看>>
Spring Framework tutorial
查看>>
【VS开发】win7下让程序默认以管理员身份运行
查看>>
【机器学习】Learning to Rank 简介
查看>>
Unity 使用实体类
查看>>
【转】通过文件锁实现,程序开始运行时,先判断文件是否存在,若存在则表明该程序已经在运行了,如果不存在就用open函数创建该文件,程序退出时关闭文件并删除文件...
查看>>
MySQL常见注意事项及优化
查看>>
流畅的Python (Fluent Python) —— 前言
查看>>
Jquery-menu-aim流畅的菜单滑动体验
查看>>