那个高手帮一下忙。帮我编一个c语言程序。。。。。。。。。。。。。。急啊 。。。急

作者&投稿:僪股 (若有异议请与网页底部的电邮联系)
编一个C语言程序~

#inlucde
void main()
{
int time,price;
double s;
printf("时间:");
scanf("%d",&time);
printf("路程:");
scanf("%f",&s);
if(time>=6&&time<=21)
{
if(s<3000) price=8;
else price=8+(s-3000)/550+1;//不到550也收一元
}
else
{
if(s<3000) price=9;
else price=8+(s-3000)/500+1;//不到500也收一元
}
printf("价格 :%d",price);
}


这样可以吗?

#include
int main(){
int I;
double C;
while(scanf("%d",&I)==1){
if(50<=I&&I<100)
C=0.05+(I-50)/500.0;
else if(100<=I&&I<150)
C=0.15+0.325*(I-100)/50.0;
else if(150<=I&&I<200)
C=0.475+0.325*(I-150)/50.0;
else if(200<=I&&I<300)
C=0.8+(I-200)/125.0;
else if(300<=I&&I<400)
C=1.6+(I-300)/200.0;
else if(400<=I&&I<500)
C=2.1+0.52*(I-400)/100.0;
else{
printf("Input Error!
");
continue;
}
printf("I:%d C:%.3lf
",I,C);
}
return 0;
}

试试看,有什么不懂得就问我吧

C语言 四舍五入函数floor()和ceil() 函数名:ceil 功能:向上舍入 用法:doubleceil(doublex); 函数名:floor 功能:向下舍入 用法:doublefloor(doublex); 程序例: #include<math.h> #include<stdio.h> intmain(void) { doublenumber=123.54; doubledown,up; down=floor(number); up=ceil(number); printf("original number %5.2lf\n",number); printf("number rounded down %5.2lf\n",down); printf("number rounded up %5.2lf\n",up); return0; } 程序输出结果: original number 123.54 number rounded down 123.00 number rounded up 124.00


...是什么意思呀?该怎么解决呢?请高手帮个忙指导一下,十
重装系统时提示“镜像文件不能在还原的分区上”,意思是:镜像文件不能存贮在系统分区。一、系统分区是还原的对象,所以,不能存贮镜像文件。打个比例吧:镜像文件,就好比是建造楼房的全部材料,系统分区,就好比是楼房的根基,把建造楼房的全部材料,全部堆放在楼房的根基上,这楼房还怎么建造呢。所以,...

英文超级烂!要恶补!请高手帮一下忙
(a lot of 和lots of有啥区别?)没区别,另外”大多数”用 the most of比较好 他说他太累了没法做任何事情,但我知道那是骗人的He said (过去式错了)he was (is 改 was)too tired to do anything,but I knew it's a trick.他是个很难看的男孩,但我们大家都很喜欢他!He's ...

哪位高手帮一下忙,我是一九八七年农历七月二十九日已时出生的,可以帮我...
本月运势迂回曲折,不稳定,好在运势越来越好,诸事皆可转危为安。本月应尽可能的远离是非,应尽量避免因口舌争执生是非,提防小人背后加害。也可以外出旅游,躲避一下临时的困难,各个方面的问题仍然不少。农历九月份 天干地支:壬戌 公历时间:2008年10月9日—2008年11月7日 本月运势有所回升,运气...

哪个高手帮一下忙。
Look,my parents are swimming.否定句:My paren't aren't swimming everyday:My parents swim everyday Tom is looking at the newspaper.一般疑问句:Is Tom looking at the newspaper?提问:What is Tom doing?Lucy is using the computer.weekend:Lucy will use the computer on the weekend....

求组装电脑一台,列出配置单即可!好心人高手帮下忙!万分感谢!
这种要求我给你一个主流偏低的3000的价格就不错了~看你需求了。如果太高跟我说我马上能给你改配置~这套配置完全符合要求甚至魔兽世界那样的游戏都可以全特效的。先说一句我这个价格稍微偏高。是市场上主流偏上的价格 如果比我给的更高那就太黑了 注意砍价 CPU AMD 羿龙II X4 965(黑盒)¥920 CPU...

...2000 中安装5个显示器 请高手帮一下忙 详细一点 谢谢了
此时我们还可以调节该屏幕的显示颜色和分辨率,调整好后单击“应用”,Windows会提示一个警告,单击“确定”,(见图七)屏幕闪烁一下后,新的设置便生效了,然后单击“是”保留新的设置即可。(见图八)参考网址 http:\/\/220.180.187.2\/htdocs\/PRINTLR.ASP?ID=5650 ...

proe中能不能删除父项保留子项啊,请高手帮一下忙,或共同探讨一下。
不管是对初级Pro\/Engineer使用者,还是对有多年软件使用经验的用户,在Pro\/Engineer的模型修改中遇到再生失败可以说是每一个Pro\/Engineer用户所最不愿意看到的。如何避免和解决再生失败对于每个Pro\/Engineer使用者来说都是非常重要的。但在实际的应用中真正能做到应付自如的却不多,更多的人选择的是逃避,...

...市朝阳沟的变化,资料500多字的,明天要写作文啊,各路高手帮一下忙
20世纪末南宁政府坚持以人为本的城市建设发展思路,对朝阳沟的治理的目标方案是:切断污水,覆盖沟面,植树种花,巧设园艺,把朝阳沟变成一道绿色长廊,一片园艺展示区,一条游览风景线,一个人们消闲聊天的场所!重修朝阳沟这是一项十分浩大的工程。朝阳沟长达14.28公里,总流域面积24.4平方公里,将其...

...主要用于玩游戏,请各位电脑高手帮一下忙给出几个合理方案,万分感谢...
想组装一台4000元左右的台式电脑,主要用于玩游戏,请各位电脑高手帮一下忙给出几个合理方案,万分感谢! 本人手上已经有几套方案,不过不知道哪个是最好的,希望大家又能给我出一下主意,兼容性要好的配置... 本人手上已经有几套方案,不过不知道哪个是最好的,希望大家又能给我出一下主意,兼容性要好的配置... ...

英语高手再帮一下忙
Jade Agate Crystal Coral Amber Beads Pearl Pine and Stone Bloodstone Cai Shi Shi Zi Yun Tie Dan Stone Picasso Chalcedony Meteorite Tree fossils Tourmaline Redwood Kuroki Rosewood Teak Rattan Wood wings Lacquerware Bone folder Green Macassar Mango wood Boxwood Porcelain Copper category Copper ...

永城市13292964346: 有哪位高手帮我编一个C语言程序,题目如下,编得好的再追加100分,不要网上复制的! -
项软康司: 这个是个简单的学生管理系统,我们学校的程序大作业就是做这个...呵呵,希望能帮到你#include<stdio.h> /*引用库函数*/ #include<stdlib.h> #include<ctype.h> #include<string.h> typedef struct /*定义结构体数组*/ { char num[10]; /*学号*/ char ...

永城市13292964346: 哪位高手帮个写个C语言
项软康司: #include<stdio.h>const int n=5;int search(int st[], int m){ int low = 1, mid, high = n, count=0;while(low<=high){ count++;mid = (low + high) /2; if(m == st[mid]) return mid; else if(st[mid] > m) high = mid - 1; else low = mid + 1;}return 0;} int compare(int st[], ...

永城市13292964346: 请哪位高手帮忙编写一个C语言程序
项软康司: #include<stdio.h> #define M 10 void main() { int c[2*M],d,e; char S1[M],S2[M]; printf("S1="); for(d=0;d<M;d++) {scanf("%c",&S1[d]);if(S1[d]=='\n') break;} printf("S2="); for(d=0;d<M;d++) {scanf("%c",&S2[d]);if(S2[d]=='\n') break;} printf("S...

永城市13292964346: 请高人帮忙编个C语言程序,让我参考一下. -
项软康司: /* HELLO.C -- Hello, world */#include "stdio.h" #include "conio.h"struct px{ long h; char xm[15]; float jb,bd,jj,hf,fw,sf; };下面..再发给你..

永城市13292964346: 请高手帮我编辑一个C语言程序 -
项软康司: #include <stdio.h> char str[100]; unsigned int strlen_input() { scanf("%s", str); return strlen(str); } int main() { printf("\nthe length of this string is %d", strlen_input()); return 0; }

永城市13292964346: 求高手帮忙写一段C语言程序
项软康司: int a[4][4]={{1,2,3,4},{12,13,14,5},{11,16,15,6},{10,9,8,7}}; for(int i=0;i<4;i++){ for(int j =0;j<4;j++){ printf("%d ",a[i][j]); } printf("\n"); }

永城市13292964346: 那个高手能帮我用C语言写个程序呀,万分多谢?
项软康司: #include<stdio.h>int main(){ printf("%d", "Hello, C"); return 0; }

永城市13292964346: 请高手帮忙编个C语言程序!!!!! -
项软康司: void main(){ int num[10], i, j; for (i = 0; i < 10; i++) { scanf("%d", &num[i]); } for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) { if (j == i) continue; if (num[i] == num[j]) break; } if (j == 10) { printf("%d\n",num[i]);} }}

永城市13292964346: 求C语言高手帮编个程序 -
项软康司: #include <stdio.h> int main() { int x,y = 0; scanf( "%d", &x ); while( x > 0 ) {y = Y*10 + x%10;x /= 10; } printf( "%d\n", y ); return 0; }

永城市13292964346: 帮忙啊 高手帮我写一个C语言程序
项软康司: #include<stdio.h> main() { char t[100]; char *a,*b; a=b=t; printf("输入字符串:"); gets(t); while(*a) { if(*a!=' ')*b++=*a; a++; } *b='\0'; puts(t); }

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网