2021年3月7日
摘要: 1 可以将string对象声明为简单变量,而不是数组 #include<iostream>#include<string>using namespace std;int main(){ char charr1[20]; char charr2[20]="jaguar"; string str1; s 阅读全文
posted @ 2021-03-07 22:56 HuJiao粉 阅读(49) 评论(0) 推荐(0)
摘要: 使用cin.getlint( ) #include<iostream>using namespace std;int main(){ const int ArSize=20; char name[ArSize]; char dessert[ArSize]; cout<<"Enter your nam 阅读全文
posted @ 2021-03-07 19:29 HuJiao粉 阅读(43) 评论(0) 推荐(0)
摘要: #include<iostream>using namespace std;int main(){ int yams[3]; yams[0]=7; yams[1]=8; yams[2]=6; int yamcosts[3]={20,30,5}; cout<<"Total yams = "; cout 阅读全文
posted @ 2021-03-07 16:39 HuJiao粉 阅读(53) 评论(0) 推荐(0)
摘要: 3.7-1 #include<iostream>const int change=12;using namespace std;int main(){ cout<<"Please entre your height:__\b\b";//单位英寸 int height; cin>>height; co 阅读全文
posted @ 2021-03-07 16:12 HuJiao粉 阅读(51) 评论(0) 推荐(0)
摘要: #include<iostream>using namespace std;int main(){ int auks,bats,coots; auks=19.99+11.99; bats=(int)19.99+(int)11.99; coots=int(19.99)+int(11.99); cout 阅读全文
posted @ 2021-03-07 09:48 HuJiao粉 阅读(31) 评论(0) 推荐(0)