c++学习(一)
来源:互联网 发布:制作动漫人物的软件 编辑:程序博客网 时间:2024/06/05 09:48
#include <iostream>//测试进制的使用using namespace std;int main(){ int chest = 42; int waist = 42; int inseam = 42; cout<<"Monsier cuts a striking figure!"<<endl; cout<<"chest = "<<chest<<" (decimal for 42)"<<endl; cout<<hex; cout<<"waist ="<<waist<<"(hexadecimal for 42"<<endl; cout<<oct; //这句话表示的是这一行以下的全部都是八进制的数 cout<<"inseam = "<<inseam<<"(octal for 42)"<<endl; cout<<endl; cout<<inseam<<endl; cout<<chest<<endl; int a; cin>>a;//输入后面不用写>>endl,这样做事不对的 //输入65输出101,这里说明八进制还在起作用 cout<<a; return 0;}
</pre><pre name="code" class="html"><pre name="code" class="html">#include <iostream>//测试转义字符和cout.put()using namespace std;int main(){ /* char ch = 'M'; int i = ch; cout<< "The ASCII code for "<<ch<<" is " <<i<<endl; //观察加一的效果 cout<<"Add one to the character code : "<<endl; ch = ch + 1; i = ch; cout<< "The ASCII code for "<<ch<<" is " <<i<<endl; //使用cout.put()函数 cout<<"Displaying char ch using count.put(ch): "; cout.put(ch); //使用cout.put()显示常量 cout.put('!'); cout<<endl; */ //我的测试部分 char ch1 = 'Z'; cout<<'Z'<<endl; cout<<'$'; cout<<'0';//这里输出的是相应的字符呀 cout<<endl; cout<<ch1<<endl; cout.put('Z'); cout<<endl<<"Done!\n"; char alarm = '\a';//计算机响铃 cout<<alarm<<"Don't di that again!\n"; cout<<"Ben\"Buggsie\"Hacker\nwas here!\n"; return 0;}
</pre><pre name="code" class="html"><pre name="code" class="html">#include <iostream>using namespace std;//演示输入密码的过程int main(){ cout<<"\a Operation\"HyperHype\"is now actived!\n"; cout<<"Enter your agent code:________\b\b\b\b\b\b\b\b"; long code; cin>>code; cout<<"\aYou entered "<<code<< " ..\n"; cout<<"\aCode verified Proceed with Plan Z3!\n"; cout<<endl; cout<<"hi \x1 there";//为什么这个there显示不出来? return 0;}
C++笔记(一)
1.什么颜色不伤眼睛?
把Hue(色调设为85,Sat(饱和度)设为90,Lum(亮度)设为205。
\b是退格符号,可以演示密码的输入过程。3_7
\a 是要电脑内部响铃。
0 0
- C++test 学习(一)
- C语言学习(一)
- c 学习笔记 (一)
- c#winform学习(一)
- C基础学习(一)
- C语言学习(一)
- C语言学习(一)
- C学习笔记(一)
- C语言学习(一)
- C ++ 学习笔记(一)
- C语言学习(一)
- C学习笔记(一)
- C++&C学习笔记(一)(基础)
- 数据结构(C++)的学习(一)
- 学习C的一些基本概念(一)
- Objective-C 学习Follow Me(一)
- Pro *C/C++学习笔记(一)
- C学习与提高一(转)
- 我写过的脚本(定时重启设备)
- int,long,long long,__int64
- My97 datePicker (WdataPicker)
- 一个请求在Struts2框架中的处理步骤
- 九度OJ 1188:约瑟夫环 (约瑟夫环)
- c++学习(一)
- [问题][已解决]java.io.IOException: Last packet not finished
- Android-ListView和ScrollView内嵌套listview的问题
- 监听textView的属性的改变,用通知,代理不好用
- 单例模式的常见应用场景
- 互联网专家资源分享(三)
- UML实践详细经典教程----用例图、顺序图、状态图、类图、包图、协作图
- tar 打包/解包命令
- Sea.js出现Uncaught TypeError: object is not a function的解决方法