#include <bits/stdc++.h> using namespace std; int main() { // 字符转大小写 cout << (char)toupper('a') << endl; cout << (char)toupper('A') << endl; cout << (char)tolower('a') << endl; cout << (char)tolower('A') << endl; puts("×××××××××××××××××××完××××美××××分××××割××××线×××××××××××××××××××"); //char 转 int,long int,long long int,double //方法一:atoi atol atoll atof char s1[]="12345654"; char s2[]="123.23"; int n1 = atoi(s1); long int n2 = atol(s1); long long int n3 = atoll(s1); double n4 = atof(s2); cout << n1 << ' ' << n2 << ' ' << n3 << ' ' << n4 << endl; //方法二:sscanf int a1; sscanf(s1,"%d",&a1); cout << a1 << endl;