当前位置:首页 » 编程软件 » rtp编程

rtp编程

发布时间: 2023-07-19 01:06:27

1. 怎样使用linphoneapi编程

版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。

本文链接:https://blog.csdn.net/qq_33487044/article/details/104080018

2. C++ C语言程序设计 题目:贷款计算器

/*
* main.c
*
* Created on: 2011-6-8
* Author: icelights
*/

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

#define APR1 0.0747 /*<1年(含1年)年利率*/
#define APR2 0.0756 /*1-3年(含3年)年利率*/
#define APR3 0.0774 /*3-5年(含5年)年利率*/
#define APR4 0.0783 /*5年以上年利率*/
#define A_TO_M 1/12 /*月利率 = 年利率 / 12*/
#define RTP 12 /*Reimbursement total periods还款总期数 =年限*12*/
#define LENGTH 80

struct LoanInfo
{
/*姓名*/
char name[LENGTH];
/*贷款总额*/
double LoanAmount;
/*贷款年限*/
double LoanYear;
/*月付*/
double MonthlyPayment;
/*总利息*/
double TotalInterest;
/*还款总额*/
double ReimbursementAmount;
/*年利率*/
double apr;

struct LoanInfo * next;
};

void CalcShow(struct LoanInfo * cur, struct LoanInfo * hd,
struct LoanInfo * prv);

int main(void)
{
int temp;
struct LoanInfo * head = NULL;
struct LoanInfo * prev, * current;

current = (struct LoanInfo *)malloc(sizeof(struct LoanInfo));

if (NULL == head)
{
head = current;
}
else
{
prev->next = current;
}/*End of if (NULL == head)*/

puts("请输入姓名");
gets(current->name);
fflush(stdin);

puts("请输入贷款数额(单位:万元)");
scanf("%lf", ¤t->LoanAmount);
fflush(stdin);

puts("请输入贷款年限");
scanf("%lf", ¤t->LoanYear);
fflush(stdin);

printf("姓名:%s,贷款年限:%lf, 贷款数额%lf",
current->name, current->LoanYear, current->LoanAmount);

prev = current;

puts("请确认Y/N");

temp = getchar();

switch(toupper(temp))
{
case 'Y' : CalcShow(current, head, prev);
break;
case 'N' : free(current);
main();
break;
default : puts("输入错误");
free(current);
break;
}

return 0;
}

void CalcShow(struct LoanInfo * cur, struct LoanInfo * hd,
struct LoanInfo * prv)
{
char lcv_temp;

if (cur->LoanYear <= 1)
cur->apr = APR1;
else if (cur->LoanYear <= 3)
cur->apr = APR2;
else if (cur->LoanYear <= 5)
cur->apr = APR3;
else
cur->apr = APR4;
/*End of if (year <= 1)*/

cur->LoanAmount = 10000 * cur->LoanAmount;
cur->ReimbursementAmount = cur->LoanAmount * pow((1 + cur->apr), cur->LoanYear);
cur->MonthlyPayment = cur->ReimbursementAmount / (cur->LoanYear * RTP);
cur->TotalInterest = cur->ReimbursementAmount - cur->LoanAmount;

printf("姓名:%s 贷款年限:%.0lf\n"
"贷款数额:%.2lf 每月还款额:%.2lf\n"
"利息合计:%.2lf 还款总额:%.2lf\n",
cur->name, cur->LoanYear, cur->LoanAmount,
cur->MonthlyPayment, cur->TotalInterest, cur->ReimbursementAmount);

puts("是否继续计算Y/N");

lcv_temp = getchar();
switch(toupper(lcv_temp))
{
case 'Y' : free(cur);
main();
break;
case 'N' : free(cur);
exit(0);
default : puts("输入错误");
free(cur);
main();
break;
}

system("pause");

}

热点内容
海外Facebook服务器地址 发布:2025-07-03 06:04:59 浏览:513
安卓开发和java开发哪个更吃香 发布:2025-07-03 05:31:09 浏览:713
小米怎么清理微信缓存 发布:2025-07-03 05:28:05 浏览:49
代练网站源码 发布:2025-07-03 05:15:05 浏览:739
mrs服务器更改ip失败 发布:2025-07-03 04:58:08 浏览:830
压缩柚子 发布:2025-07-03 04:48:16 浏览:183
qq和安卓哪个用的人多 发布:2025-07-03 04:31:37 浏览:656
日本溥仪访问 发布:2025-07-03 04:24:27 浏览:674
java文件遍历 发布:2025-07-03 04:22:22 浏览:141
android画虚线 发布:2025-07-03 04:11:04 浏览:386