Programming 板


LINE

这一题的题目我看不太懂QQ 有人能帮忙解释一下吗? 我就我所理解的先打出来,麻烦帮忙指正了谢谢>< ------ The value e^x can be approximated by the sum 1 + x^1/1! + x^2/2! + x^3/3! +.........+ x^n/n!   Write a program that takes a value x as input and outputs this sum for n taken to be each of the values 1 to 100. //Q1:让使用者可以输入x,并分别输出n=1(即1+x^1/1!),..,n=100(即1+...+x^100/100!) 还是 输出n=1(即x^1/1!), n=2(即x^2/2!),...,n=100(即x^100/100!)呢? The program should also output e^x calculated using the predefined function exp. The function exp is a predefined function such that exp(x) returns an approximation to the value e^x. //还要输出e^x的值(使用者输入之x, n为无限大)(收敛值?) //Q2: predefined function exp,是指要我先写一个exp()出来吗? The function exp is in the library with the header file cmath. Your program should repeat the calculation for new values of x until the user says she or he is through. //Q3:这句我超不懂QQ 是跟我说在<cmath>里有exp可以参考的意思吗 囧 第2句我不懂他的意思,不是已经让user输入过x了吗@_@ repeat the calculation 是? new value of x是? 直到user怎样呢QQ? Use variables of type double to store the factorials or you are likely to produce integer overflow (or arrange your calculation to avoid any direct calculation of factorials). //Q4: 用double变数去储存factorials(n!的值吗?),不然可能会有整数 变数漏掉浮点数、无法进行有浮点数的除法计算的问题? 或是避免计算中直接去 计算factorials??这是什麽意思呢QQ 100 lines of output might not fit comfortably on your screen. Output the 100 output values in a format that will fit all 100 values on the screen. For example, you might output 10 lines with 10 values on each line. 请我每10行输出10个值? 麻烦大家帮忙看看了 谢谢QQ --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 1.175.137.110 ※ 编辑: peggypiano 来自: 1.175.137.110 (07/17 12:27)
1F:→ MOONRAKER:你的id很熟 是不是重修好几次了 |D 1.34.60.15 07/17 22:15
2F:→ fkmt:该不会嘉大吧 140.109.127.8 07/19 11:15
3F:→ peggypiano:我第一次修@@ 1.175.137.110 07/19 12:09
4F:→ peggypiano:f大也是吗?? 1.175.137.110 07/19 12:21







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:WOW站内搜寻

TOP