摘要:
#include<iostream>using namespace std;int main(){ int i,j,k,p,q; cout<<"输入三角的高度:"; cin>>k; for(i=0;i<k;i++) { for(p=0;p<k-i;p++) cout<<" "; cout<<"x"; for(j=0;j<=2*i-1;j++) cout<<"x"; //if(i) //cout<<"*&q 阅读全文
摘要:
通过getche实现:Enter a number:123456 Number is:12345程序如下:#include<iostream>using namespace std;#include<conio.h>int main(){long a,b=0;char ch='a';cout<<"Enter a number:";while((ch=getche())!='\r'){ a=ch-48;//a=ch-'0'; b=b*10+a;}cout<<"\n Num 阅读全文