首页 > 其他分享 >2023.4.15

2023.4.15

时间:2023-04-15 22:22:32浏览次数:41  
标签:15 cout profit u1 tax start 2023.4 end

 1 #include<iostream>
 2 #include <math.h>
 3 #define taxbase 3500
 4 using namespace std;
 5 /*typedef struct{
 6 int id;
 7 char name[20];
 8 int age;
 9 char address[50];
10 }user;*/
11 typedef struct{
12 long start;
13 long end;
14 double taxrate;
15 }taxtable;
16 taxtable T[]={{0,1500,0.03}, {1500,4500,0.1}, {4500,9000,0.2},
17 {9000,35000,0.25},{35000,55000,0.3},{55000,80000,0.35},{80000,1e10,0.45}};
18 double caculatetax(long profit)
19 {
20 int i;
21 double tax=0.0;
22 profit-=taxbase;
23 for(i=0;i<sizeof(T)/sizeof(taxtable);i++)
24 {
25     if(profit>T[i].start){
26         if(profit>T[i].end){
27         tax+=(T[i].end-T[i].start)*T[i].taxrate;
28         }
29         else{
30         tax+=(profit-T[i].start)*T[i].taxrate;
31         }
32         profit-=T[i].end;
33         cout<<"征收范围为"<<T[i].start<<"-"<<T[i].end<<"征收金额为:"<<tax<<endl;
34     }
35 }
36 return tax;
37 }
38 void main(){
39     long profit;
40     double tax;
41     /*user u1;
42     cout<<"请输入id"<<endl;
43     cin>>u1.id;
44     cout<<"请输入姓名"<<endl;
45     cin>>u1.name;
46     cout<<"请输入年龄"<<endl;
47     cin>>u1.name;
48     cout<<"请输入地址"<<endl;
49     cin>>u1.address;*/
50     cout<<"请输入收入金额:"<<endl;
51     cin>>profit;
52     tax=caculatetax(profit);
53     cout<<"个人所得税为:"<<tax;
54 }

 

标签:15,cout,profit,u1,tax,start,2023.4,end
From: https://www.cnblogs.com/xuxingkai/p/17322088.html

相关文章

  • C/C++运动场馆预订管理系统[2023-04-15]
    C/C++运动场馆预订管理系统[2023-04-15]题目14:运动场馆预订管理系统对旅游管理进行简单模拟。运动场地管理:包括场地名称(如羽毛球场A、乒乓球场B等)、开放时间、计费时长、价格。注意:场地可能增减、同一场地的租金在不同时间段可能不同。用户信息管理:包括用户姓名、联系方式等信......
  • 2023年4月15日
    登陆界面<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas......
  • 2023.4.15——软件工程日报
    所花时间(包括上课):2h代码量(行):0行博客量(篇):1篇今天,上午参加了春季招聘会。我了解到的知识点:1.复习了session和cookie的知识;......
  • 【Visual Leak Detector】在 VS 2015 中使用 VLD
    说明使用VLD内存泄漏检测工具辅助开发时整理的学习笔记。本篇介绍在VS2015中使用VLD。同系列文章目录可见《内存泄漏检测工具》目录目录说明1.使用前的准备3.在VS2015中使用VLD3.1无内存泄漏时的输出报告3.2有内存泄漏时的输出报告4.无法正常使用的可能原因1.......
  • kuangbin专题一 简单搜索 点火游戏(FZU-2150)
    FireGameDescriptionFatbrotherandMazeareplayingakindofspecial(hentai)gameonanN*Mboard(Nrows,Mcolumns).Atthebeginning,eachgridofthisboardisconsistingofgrassorjustemptyandthentheystarttofireallthegrass.Firstlyt......
  • 4.15打卡
    #include<iostream>#include<iomanip>usingnamespacestd;intmain(){charA,D,S,Q,ch;while(ch!='Q'){cout<<"Menu:A(dd)D(elete)S(ort)Q(uit),SelectOne:";cin>>ch;if(ch=='A&#......
  • 2023-04-15 uniapp 点击事件冒泡
    简而言之,即父子元素都有点击事件,这时候子元素触发点击事件会连同父元素的点击事件一并触发,这就是冒泡;而需求就是子不触父。解决方案:子元素的点击事件由原来的@click或者@tap统统换成@tap.stop,据说@tap.stop比@click.stop好。注:只需改变子元素点击事件,子变父不变。......
  • ELEC3115 ENGINEERING
    ELEC3115–ELECTROMAGNETICENGINEERINGPartBassignment–T12023DueDate:23:59pm,Monday24thApril2020(Week11)AssignmentssubmittedaftertheDueDatewillbepenalizedbya20%marksreduction.CutoffDate:23:59pm,Tuesday25thApril2020(Week11)......
  • 23.4.15 NOIP2010提高游记
    第一次做提高,之前做的都是普及,还是感觉挺难的,心态有点裂开。1.机器翻译这题首先一看就是一道模拟题目,要注意的是字典的内存问题,在超内存以后要减1,直接上代码:-),时间复杂度O(n)1#include<bits/stdc++.h>2#pragmaGCCopzimize(3)3usingnamespacestd;4inlinelon......
  • Lenovo Legion 5 15IMH05H电脑 Hackintosh 黑苹果efi引导文件
    原文来源于黑果魏叔官网,转载需注明出处。(下载请直接百度黑果魏叔)硬件型号驱动情况主板LenovoLegion515IMH05H处理器Intel(R)Core(TM)[email protected]已驱动内存16GB2933MHzDDR4已驱动硬盘Intel760p512GB已驱动显卡Intel(R)UHDGraphics630(1GB)......