c++程序设计第3版谭浩强课后答案
C++编程:输入10个学生的姓名,学号和成绩,将其中不及格的姓名、学号和成绩输出。 以下是此题的【c++源代码】 #include <iostream> #include <string> using namespace std; const int n=10; string name[n]; int num[n],score.....
阅读全文
输入n个字符串,把其中以字母A打头的字符串输出。 C++ 以下是此题的【c++源代码】 #include <iostream> #include <string> using namespace std; int main() { const int n=5; string str; for(int i=0;i<n;i++) &.....
C++编程:输入一个字符串,把其中的字符按逆序输出。如输入LIGHT,输出THGIL. 1. 用字符数组方法; 2. 用string 方法
以下是此题的【c++源代码】 1. 用字符数组方法的【c++源代码】 #include <iostream&.....
C++编程:输入n哥字符串,把其中以A打头的字符串输出。 以下是此题的【c++源代码】 #include <iostream> #include <string> using namespace std; int main() { const int n=5; int i,j; string str[n],te.....
有一行电文,已按下面规律译成密码: A->Z a->z B->Y b->y C->X c->x … … 即第一个字母变成第26个字母,第i个字母变成第(26-i+1)个字母。非字母字符.....
C++编程:编写一个程序,将两个字符串连接起来,结果取代第一个字符串。 1. 用字符数组,不用strcat函数(即自己写一个具有strcat函数功能的函数); 2. 用标准库中的strcat函数; 3. 用string 方法定义字符串变量。 以下是此.....