![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++学习
文章平均质量分 52
诺青235
这个作者很懒,什么都没留下…
展开
-
C++练习(五)
第六章 分支语句和逻辑运算符 1,编写一个程序,读取键盘输入,直到遇到@符号为止,并回显输入(数字除外),同时将大写字符转换为小写,将小写字符转换为大写(别忘了cctype函数系列) #include<iostream> #include<cctype> using namespace std; int main() { char ch; cout<<"Enter a char: "; cin.get(ch); while(ch != '@') { if(i原创 2021-03-03 17:31:48 · 75 阅读 · 0 评论 -
C++练习(四)
1,编写一个要求用户输入两个整数的程序。该程序将计算并输出这两个整数之间(包括这两个整数)所有整数的和。这里假设先输入较小的整数。例如,如果用户输入的是2和9,则程序将指出2~9之间所有整数的和为44. #include<iostream> using namespace std; int main() { int value_one,value_two; int result = 0; cout<<"Enter two integers(first enter the sma原创 2021-03-01 21:38:34 · 93 阅读 · 0 评论 -
C++练习(三)
第四章 复合类型 1,编写一个C++程序,输出如下: What is your first name? Betty Sue What is your last name? Yewe What letter grade do you deserve? B What is your age? 22 Name: Yewe, Betty Sue Grade: C Age: 22 程序将向下调整程序 #include<iostream> uisng namespace std; int main() {原创 2021-02-24 23:35:58 · 291 阅读 · 0 评论 -
C++练习(二)
1,编写一个程序,要求用户使用一个整数指出自己的身高(单位英寸),然后将身高转换为英尺和英寸。该程序使用下划线字符来只是输出位置。另外,使用一个const符号常量来表示转换因子。 #include<iostream> using namespace std; const int foot = 12; int main() { int myHeight; cout<<"Enter you height:_____\b\b\b\b\b"; cin>>myHe原创 2021-02-23 22:39:13 · 963 阅读 · 3 评论 -
C++练习(一)
第二章 开始学习C++ 1,编写一个C++程序,它显示你的姓名和地址。 #include<iostream> using namespace std; int main() { cout<<"Tom"<<" "<<"English"; cout<<endl; return 0; } 2,编写一个C++程序,它要求用户输入一个以long为单位的距离,然后将它转换为码(一long等于220码)。 #include<ios原创 2021-02-22 21:51:27 · 257 阅读 · 0 评论