最近很多朋友都问我,c++有多难?c++编程顺利吗?c++适合让孩子(>=9)学习吗?
首先,要看你的编程基础怎么样:一般以下这些有1~2个符合的适合学习编程:
1 数学好(75>分数)
2 思维敏捷
3 想象力丰富
4 敢想敢干
以上是一些小小的总结,下面是编程教学:
//GPT的粉丝,看这里!158行代码任你使用,拥有低配版GPT,亲测可用
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"hello,you can call me every thing. So can you give me a name?"<<endl;
string str;
cout<<"my name is:";
cin>>str;//name
if(str=="随便"){
cout<<"好吧"<<endl;
}
for(int i=0;i<=10;i++){
cout<<"初始化中!"<<endl;
}
cout<<endl<<"ok,you can call me "<<str<<"."<<endl<<endl;
cout<<"can I help you? (you can use /~~ to talk)"<<endl<<endl;
cout<<"do you want chang language?(Chinese/Englishi/中文)"<<endl<<endl;
string str2;//language
cin>>str2;
if(str2=="Chinese"||str2=="chinese"||str2=="中文"){
cout<<str<<" "<<"好的!改变成功!"<<endl;
cout<<str<<" "<<"请输入指令 /..."<<endl;
for(int i;i<=100;i++){
if(i==100){
cout<<"次数已用完!!!请重启";
}
string str3;
cin>>str3;
if(str3=="/求救"||str3=="求救"){
cout<<str<<":"<<"110 还是 911?"<<endl;
cout<<str<<":"<<"还有什么请求?"<<endl;
}
else if(str3=="/音乐"||str3=="音乐"){
cout<<str<<":"<<"我是一个粉刷匠,粉刷本领强!"<<endl;
cout<<str<<":"<<"https://music.163.com/"<<endl;
cout<<str<<":"<<"请问还有什么能帮您的吗?"<<endl;
}
else if(str3=="/导航"||str3=="导航"){
cout<<str<<" "<<"去哪?"<<endl;
string str5;
cin>>str5;
cout<<str<<":"<<"好的,已为您找到相关网站:去"<< str5<<"的路线 "<<"https://www.amap.com/"<<endl;
cout<<str<<":"<<"请问还有什么能帮您的吗?"<<endl;
}
else if(str3=="/你好"||str3=="你好"){
cout<<str<<":"<<"你好!有什么可以帮到你的吗?"<<endl;
}
else if(str3=="/笑话"||str3=="笑话"||str3=="讲笑话"){
cout<<str<<":"<<"怎么了?不开心么?要不要讲个笑话,开心一下?(输入 好的;不用)"<<endl;
string str7;
cin>>str7;
if(str7=="好的"){
cout<<" "<<"一人,到花鸟市场买仓鼠,想试试鼠贩人品,就装作不懂问:“请问两只仓鼠可以在一个笼子里养吗?"<<endl<<"鼠贩诚恳地说:“不行啊,两只在一个笼子里是会打架的。"<<endl<<endl<<"心里正在想遇上有良知的了,鼠贩又补充了一句:要不你买三只吧,这样那两只打架的时候还有人劝架。"<<endl;
}
else{
cout<<str<<":"<<"还有什么事么?"<<endl;
}
}
else if(str3=="/功能"||str3=="功能"){
cout<<str<<":"<<"我会的太少,只会一些:讲笑话,查单词,导航,打电话(在开发),聊天(在开发)"<<endl;
}
else if(str3=="/退下"||str3=="退下"){
cout<<str<<":"<<"再见!"<<endl;
break;
}
else if(str3=="/查单词"||str3=="查单词"){
for(int j;j<=5;j++){
cout<<str<<":"<<"查什么?"<<endl;
string str6;
cin>>str6;
if(str6=="hello"){
cout<<str<<":"<<"中文是; "<<"你好"<<endl;
}
else if(str6=="hello,wold"){
cout<<str<<":"<<"中文是; "<<"你好世界"<<endl;
}
else if(str6=="fuck"){
cout<<str<<":"<<"**请文明用语**"<<endl;
}
else if(str6=="退出"){
cout<<endl;
cout<<"已退出";
break;
}
}
}
else if(str3=="/Englishi"||str3=="Englishi"){
cout<<"ok,done!"<<endl;
cout<<"can I help you?"<<endl;
for(int h;h<=100;h++){
string str4;
cin>>str4;
if(str4=="/help"||str4=="help"){
cout<<"110 or 911?"<<endl<<"are you ok?" ;
cout<<"can I help you more?"<<endl;
}
else if(str4=="/music"||str4=="music"){
cout<<"dota do~ doda~ lalala~"<<endl;
cout<<"can I help you more?"<<endl;
}
else if(str4=="/ty"||str4=="ty"){
cout<<"where?"<<endl;
cout<<"can I help you more?"<<endl;
}
}
}
}
}
else{
for(int j;j<=100;j++){
string str1;
cin>>str1;
if(str1=="/help"||str1=="help"||str1=="SOS"||str1=="...---...---...---"){
cout<<"110 or 911?"<<endl<<"are you ok?" ;
}
else if(str1=="/music"||str1=="music"){
cout<<"dota do~ doda~ lalala~"<<endl;
}
else if(str1=="/ty"||str1=="ty"){
cout<<"where?"<<endl;
}
}
}
cout<<"日记:作者在2024.2.2日,心情不好,更新不全。"<<endl<<endl;
cout<<"日记:作者在你使用完后,心情愉快。"<<endl<<endl;
cout<<"Diary: Author in February 2024.2.2, bad mood, update incomplete."<<endl<<endl;
cout<<"Diary: the author is in a good mood after you use it."<<endl<<endl<<endl<<endl;
return 0;
}
这是我发的第1个文章附带的代码。
其实,无论是谁,只要用心都能做出这种作品。
//简单的if语句,else if语句,足以构成一段对话的基本框架
if(str3=="/求救"||str3=="求救"){
cout<<str<<":"<<"110 还是 911?"<<endl;
cout<<str<<":"<<"还有什么请求?"<<endl;
}
else if(str3=="/音乐"||str3=="音乐"){
cout<<str<<":"<<"我是一个粉刷匠,粉刷本领强!"<<endl;
cout<<str<<":"<<"https://music.163.com/"<<endl;
cout<<str<<":"<<"请问还有什么能帮您的吗?"<<endl;
}
//简单的#include <bits/stdc++.h> 万能库 ,做出百行代码
#include<bits/stdc++.h>
using namespace std;
int main(){
return 0;
}
//代码在你手中,塑造出你心中所想
那你还觉得c++难么?
附赠一个装13小技巧
在电脑上同时按Window键+r键
触发一个叫运行的页面
输入‘cmd’
切换到管理员界面后(这一步是自动的)
输入color 加上英文字母小写+换行
输入dir/s
使用方法:dir/c表示调取c盘,你应该知道咋用了!