mirror of
http://106.12.3.193:3000/violeteverisland/learn_cpp.git
synced 2026-03-07 17:17:33 +08:00
37 lines
666 B
C++
37 lines
666 B
C++
//
|
|
// Created by viole on 2026/2/18.
|
|
//
|
|
#include "iostream"
|
|
#include "windows.h"
|
|
using namespace std;
|
|
|
|
void purchase();
|
|
|
|
int main() {
|
|
// system("chcp:65001");
|
|
SetConsoleOutputCP(CP_UTF8);
|
|
int age;
|
|
float height ;
|
|
char gender;
|
|
gender = 'M';
|
|
string name;
|
|
name = "xiaoming";
|
|
height = 180.5;
|
|
age = 21;
|
|
cout<<to_string(age+height+gender)+name<<endl;
|
|
cout<<age<<endl;
|
|
cout<<"开始计算花费"<<endl;
|
|
purchase();
|
|
return 0;
|
|
}
|
|
void purchase() {
|
|
float fee = 50;
|
|
int a = 1 ,b = 2 ,c = 3;
|
|
cout<<a<<b<<c<<endl;
|
|
|
|
fee = fee-5;
|
|
fee = fee +10;
|
|
fee = fee -2 ;
|
|
fee = fee*2;
|
|
cout<<fee<<endl;
|
|
} |