C++ 写出下列程序段运行时的输出结果
Posted Roam-G
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++ 写出下列程序段运行时的输出结果相关的知识,希望对你有一定的参考价值。
3. 写出下列程序段运行时的输出结果
#include <iostream.h>
#include <iomanip.h>
void print(int , char );
void main( )
char a,b; b='A';
for(int i=5; i>=1; i--)
a='*';
cout<<setw(i)<<a;
print(i,b);
cout<<a<<endl ;
void print(int n, char ch)
char cs=ch+1;
int j;
for(j=1; j<=5-n; j++)
cout<<ch<<cs ;
3. 写出下列程序段运行时的输出结果
#include <iostream.h>
#include <iomanip.h>
void print(int , char );
void main( )
char a,b; b='A';
for(int i=5; i>=1; i--)
a='*';
cout<<setw(i)<<a;
print(i,b);
cout<<a<<endl ;
void print(int n, char ch)
char cs=ch+1;
int j;
for(j=1; j<=5-n; j++)
cout<<ch<<cs ;
以上是关于C++ 写出下列程序段运行时的输出结果的主要内容,如果未能解决你的问题,请参考以下文章