C++一些小技巧

1.交换数值:使用swap(A,B)即可。相应头文件为iostream。

2.getline(cin,s)  //接受一个字符串,可以接受空格并输出。必须包含头文件#include<cstring>;

3.extern int islower(int c); 用法:#include <ctype.h> 功能:判断字符c是否为小写英文字母

4.toupper(s[0]);用法:#include <ctype.h>功能:小写转大写


 

posted @ 2018-05-22 21:48  DF11G0001  阅读(126)  评论(0编辑  收藏  举报