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++ 写出下列程序段运行时的输出结果的主要内容,如果未能解决你的问题,请参考以下文章

请写出如下PHP程序的运行结果,并给出计算过程,即$sum由哪些数相加而得。

Python如何写出计算过了多少天的程序?

Dev c++输出结果不对

如何提取Dos下程序输出的结果?

[问答题]写出下列程序的输出结果:

如何在MFC中把程序的运行结果输出到界面上