This commit is contained in:
2026-02-23 20:46:42 +08:00
commit c5f2ebb5d6
15 changed files with 484 additions and 0 deletions

37
变量.cpp Normal file
View File

@@ -0,0 +1,37 @@
//
// 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;
}