#include<iostream>

int main()
{
char ch;
std::cout << "Type, and I shall repeat.\n";
std::cin.get(ch);
while (ch != '.')
{
if (ch == '\n')
std::cout << ch;
else
std::cout << ch + 1;//char强转成int了 输出int
std::cin.get(ch);
}
std::cout << "\nPlease excuse the slight confusion.\n";
std::cin.get();
std::cin.get();
return 0;
}

std::cout << char + int的更多相关文章

  1. no suitable ctr exists to convert from 'int' to 'std::basic_string<char,std::char_traits<char>,std::allocator<char> >

    int xfun(int *a,int n) { int x = *a;//a的类型是int *,a+1跳动一个int的长度 ; pa < a + n; pa++)//指向同一个类型的指针比较大 ...

  2. std::cout彩色输出

    Mac OS效果 Windows 效果 想写这个东西其实是因为最近要写个命令行的工具,但是有个问题是什么呢?就是传统的那个黑漆漆的窗口看起来很蛋疼.并且完全看不到重点,于是就想起 来这么一个东西.相对 ...

  3. C++ 中 string, char*, int 类型的相互转换

    一.int 1.int 转换成 string 1) to_string函数 —— c++11标准增加了全局函数std::to_string: string to_string (int val); s ...

  4. C语言中string char int类型转换

    C语言中string -- ::) 转载 ▼ 标签: 操作符 int char c语言 类型转换 分类: C/Cpp ,char型数字转换为int型 "; printf(]-');//输出结 ...

  5. c++ std::cout重定向到文件

    cout默认是与监视器(屏幕)相连,cout出来的内容会输出到屏幕上,通常是会在命令行窗口之中.但有时,我们希望将cout出来的具体日志.错误信息写到某个文件之中,而屏幕上仅仅显示出当前进行的任务,以 ...

  6. iOS出现 Undefined symbols for architecture armv7 std::basic_string<char, std::char_traits<char>

    Undefined symbols for architecture i386: “_OBJC_CLASS_$_XXX”, referenced from: objc-class-ref in XXX ...

  7. std::cout和printf

    禁止std::cout和printf混用,在多线程环境下可能导致coredump. 说明:printf和std::cout分别为标准c语言与c++中的函数,两者的缓冲区机制不同(printf无缓冲区, ...

  8. error LNK2019: 无法解析的外部符号 "class std::basic_ostream<char,struct std::char_traits<char> >

    1,VS2013: 错误 1 error LNK2019: 无法解析的外部符号 "class std::basic_ostream<char,struct std::char_trai ...

  9. [ c++] cmake 编译时 undefined reference to `std::cout' 错误的解决方案

    cmake ..  和 make 之后,出现如下错误 Linking CXX executable ../../../bin/ModuleTest CMakeFiles/ModuleTest.dir/ ...

随机推荐

  1. Spring boot FastJson

    介绍:FastJson 是ailibaba 的一款解析Json的开源框架 使用方式1 引入jar 包 <dependency>    <groupId>com.alibaba& ...

  2. intelj idea安装和配置

    1|0优势 intellij idea 是目前公认的java最好的开发工具之一,商业版的IntelliJ应该包含了对 HTML5.CSS3.SASS.LESS.JavaScript.CoffeeScr ...

  3. POJ 1330 Nearest Common Ancestors(LCA Tarjan算法)

    题目链接:http://poj.org/problem?id=1330 题意:给定一个n个节点的有根树,以及树中的两个节点u,v,求u,v的最近公共祖先. 数据范围:n [2, 10000] 思路:从 ...

  4. Porsche Piwis II V14. three hundred and fifty computer software Tester II

    Porsche piwis tester 2 Help Devices: SERP automatio tranny, air-conditioner, SRS, ABDOMINAL MUSCLES, ...

  5. linux下VLAN设置

    1. 安装vlan(vconfig)和加载8021q模块 [root@test0001~]#yum install vconfig [root@test0001~]#modprobe 8021q [r ...

  6. linux下can调试工具canutils安装过程记录

    https://www.cnblogs.com/chenfulin5/p/6797756.html 一.下载源码 下载canutils和libsocketcan libsocketcan地址:http ...

  7. HFA and outhandler differentiate or not

    better trouble shooting auto-open accidently? HFA not stable? check code modification ASAP!!!

  8. HashMap的实现原理总结

    HashMap基于hashing原理,我们通过put()和get()方法储存和获取对象. 当我们将键值对传递给put()方法时,它调用键对象的hashCode()方法来计算hashcode,让后找到b ...

  9. 关于actor模型

    actor model是1973年就提出的一个分布式并发编程模型,在erlang语言中得到广泛支持和应用.目前Java中也出现了很多支持actor模型的库:akka.killim.jetlang等等, ...

  10. 一种基于 Numpy 的 TF-IDF 实现报告

    一种基于 Numpy 的 TF-IDF 实现报告 摘要 本文使用了一种 state-of-the-art 的矩阵表示方法来计算每个词在每篇文章上的 TF-IDF 权重(特征).本文还将介绍基于 TF- ...