Skip to content
neuroai

neuroai

  • Home
  • All Courses
  • Log In
  • About
neuroai
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 Quiz
Back to Lesson
Next Topic

About NeuroAI

NeuroAI 提供 C++、数据结构与算法、信息学真题、数学竞赛和 AP 微积分课程。

Courses

All Courses
C++ 程序设计
数据结构与算法
信息学奥赛真题

Account

Log In
Lost Password

© 2026 neuroai - WordPress Theme by Kadence WP

Facebook X Instagram
Scroll to top
  • Home
  • All Courses
  • Log In
  • About