[不是问题,不合适] C ++。如果声明;计算分钟成本。 [英] [Not a question, inappropriate] C++. if statement; calculating cost of minute.

查看:76
本文介绍了[不是问题,不合适] C ++。如果声明;计算分钟成本。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

拨打纽约三分钟电话,费用为1.15美元。每增加一分钟的费用为0.26美元。给定呼叫的总长度(以分钟为单位),计算并打印成本。分钟输入,成本输出。



分钟/费用

1 = $ 1.15

2 = $ 1.15

3 = $ 1.15

4 = $ 1.41

5 = $ 1.67



每分钟3分钟后再花费0.26美元。

i刚试过这些代码来解决它,但我无法继续完成。



A three-minute telephone call to New York, costs $1.15. Each additional minutes costs $0.26. Given the total length of a call in minutes, calculate and print the cost. minutes are input and costs are output.

min / cost
1 = $1.15
2 = $1.15
3 = $1.15
4 = $1.41
5 = $1.67

each minute cost additional $0.26 after 3 minute.
i have just tried these codes to solve it but i can't continue to finish.

#include <iostream>
using namespace std;

int main ()
{
 int min;
cout << " enter minute to calculate cost: ";
cin >> min;
if (min <= 3)
   cout << " cost is $1.15 " << endl; 


  return 0;
}





请写一些程序来完成这个项目。我不介意你是不是完全理解这个问题,因为我的英语不好。



please write some program to finish this project. i don't mind if u don't fully understand the question because my english is not good.

推荐答案

1.15。每增加一分钟费用
1.15. Each additional minutes costs


0.26。给定呼叫的总长度(以分钟为单位),计算并打印成本。输入分钟并输出成本。



min / cost

1 =
0.26. Given the total length of a call in minutes, calculate and print the cost. minutes are input and costs are output.

min / cost
1 =


1.15

2 =
1.15
2 =


这篇关于[不是问题,不合适] C ++。如果声明;计算分钟成本。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆