跳到内容

neuroai

  • Home
  • All Courses
  • 科研研学
  • 更新日志
  • 点名系统
  • Log In
  • About
neuroai

数字与字符串

  1. C++程序设计
  2. 第七章 字符串
  3. 数字与字符串

字符型数字,不能做数学运算,只能做字符运算。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#include <iostream>
using namespace std;

int main()
{
    int x=10,y=20;
    cout<<x+y<<endl;
    string a="10",b="20";
    cout<<a+b<<endl;
   // cout<<x+a;

    return 0;
}
Previous 测验
Back to 课
Next 主题

© 2026 neuroai Kadence WP 制作的 WordPress 主题

  • Home
  • All Courses
  • 科研研学
  • 更新日志
  • 点名系统
  • Log In
  • About