范文无忧网范文学习范文大全

用C语言来编写:商品销售统计程序

02月23日 编辑 fanwen51.com

[用C语言编写一个计算薪水的程序]/*工资计算程序*/ #include main() { float originWage; /*应发工资*/ float realWage; /*实发工资*/ float tax; /*所缴税款*/ int i,hour,amount,money; printf("请选择工资种...+阅读

#include#include#include#include//system("cls")//清屏#include//getche()using namespace std;//全局变量int i=0;//已录入商品总个数char ch;//cin>>chint n;//case(n)char code[10];char name[10];char unit[10];int amount;float unitprice;float total=0;//总价ofstream f1("./test.txt");ofstream f2("./sell.txt");//构建输出流,没有文件就建立class Goods{private: char code[10];//代码 char name[10];//名称 char unit[10];//单位 int amount;//总数 float unitprice;//单价public: Goods(); Goods(char co[10],char na[10],char un[10],int am,float unpr);//构造函数 void f_write();// 录入 void f_change();//改变 void f_delete();//删除 void display();//显示全部商品信息 void s_buy();//买入};//构造函数Goods::Goods(){}Goods::Goods(char co[10],char na[10],char un[10],int am,float unpr){ strcpy(code,co); strcpy(name,na); strcpy(unit,un); amount=am; unitprice=unpr; }Goods *g[50];//商品信息录入void Goods::f_write(){ cout

延伸阅读:

编写一个c语言程序不断地要求输入成绩分数如果分数小于0或者#include int main() {int a,z=0; for(;;){ scanf("%d",&a); if(a100) printf("你输入的是无效分数\n"); else z=z+a; printf("当前分数:%d\n",z); if(z>999) break; } printf("总分是:%d",...

求C语言编写的表白程序要代码呃,你还不如用vbs,网上也有一堆教程和例子,很简单,随便看一下就知道怎么写了。1234567891011121314 DimmyName,herName,myNameAns,herNameAnsmyName="池早早"herName="欧浩辰"MsgBox...

C语言程序设计题目#include char *strcpy(char *d,char *s) { char *p=d; while(*p++=*s++); return d; } char *strcat(char *d,char *s) { char *p=d; for(;*p;p++); strcpy(p,s); return d...

C语言程序设计试题结果 1 1 2 3 5 8 13 21 就是 第一次循环 屏幕上输出 1 1 1 + 1 = 2 1 + 2 = 3 第二次 屏幕上输出 2 3 2 + 3 = 5 3 + 5 = 8 第三次 屏幕上输出 5 8 5 + 8 = 13 13 + 8 = 21...

用C语言编写一个学生信息管理系统#include "stdio.h" #include "stdlib.h" #include "string.h" #include "conio.h" jiemian(); struct student { char name[50]; char sex[5]; int age; char num[50]; float score...

用C编写一个程序学生信息管理系统#include#include#include#include#defineMax 1000usingnamespacestd;classstudent{private: char name[20]; int number; int grade;public: student(char*,int,int); char...

用c语言设计这样的学生成绩统计系统!急#include#include#include#define MAX 1000/*定义学生成绩信息结构*/struct stu{ char id[8]; char name[8]; double Chinese; double Math; double English; double averag...

用C语言做一个学生成绩统计系统求帮忙源代码。可以给你。需要点时间。现在在上课。#includevoid main() { int Password =0,i=0,sum=0; clrscr(); printf("\n===请输入密码!====\n"); while(Password != 1234) { if(i>3) {...

c语言学生期末成绩统计#includeintmain(){ints[20];intsum,max,min,excellent,good,pass,fail;inti;sum=0;max=0;min=100;excellent=good=pass=fail=0;for(i=0;imax)max=s[i];if(s[i]=90)excellen...

推荐阅读
图文推荐
栏目列表