早教吧 育儿知识 作业答案 考试题库 百科 知识分享

求助几道简单的C++题目~6.Printthefollowingpattern,usinghorizontaltabstoseparatenumbersinthesameline.Lettheuserdecidehowmanylinestoprint(i.e.whatnumbertostartat).5545435432543213.Writeaprogramtotakein

题目详情
求助几道简单的C++题目~
6.Print the following pattern, using horizontal tabs to separate numbers in the same line. Let the user decide how many lines to print (i.e. what number to start at).
5
5 4
5 4 3
5 4 3 2
5 4 3 2 1
3.Write a program to take in a number from a user, find its reciprocal and add it to a running sum (the running sum will be 0, when the loop initially starts). The program should repeat this procedure 10 times. However, if the user enters 0, the loop should exit, and if the user enters 1, nothing should be added. Print the final sum at the end of the program.
▼优质解答
答案和解析
6的……3的还在编……
#include
using namespace std;
int main()
{
int n,i,j;
cin>>n;
i=n;
while(i--)
{
for(j=n;j>i;j--)
cout