哪位大哥能帮我解决这道题目不胜感激
1.编写一控制台程序,使用循环的嵌套输出九九乘法表,要求算式完整输出。using System;
using System.Collections.Generic;using System.Linq;using System.Text;
namespace _99Mul{
class Program { static void Main(string[] args) { Console.WriteLine("九九乘法表:"); for (int i = 1; i <= 9; i++)//i是行数 { for (int j = 1; j <= i; j++)//列数j
{ Console.Write("{0}*{1}={2} ",i,j,i*j); } Console.WriteLine(); } Console.ReadLine(); } }} --------------------编程问答-------------------- C#? --------------------编程问答-------------------- 嗯,是的 --------------------编程问答-------------------- 这里是C++贴... --------------------编程问答-------------------- 那能解决么 --------------------编程问答-------------------- C#啊??? --------------------编程问答-------------------- using system...
围观啊... --------------------编程问答-------------------- 这好像是课后作业吧 --------------------编程问答-------------------- #include "stdafx.h"
#include <conio.h>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int i,j,k;
for (i=1; i<=9; i++)
{
k = 1;
for (j=1; j<=i; j++)
{
cout<<k<<"*"<<i<<"="<<i*k<<"\t";
k++;
}
cout<<endl;
}
getch();
return 0;
}
--------------------编程问答-------------------- 好怀念的题目 --------------------编程问答-------------------- 刚上学时觉得能做这种练习很了不起,学生时代真有意思。
using System;--------------------编程问答--------------------
using System.Linq;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
(from i in Enumerable.Range(1, 9)
from j in Enumerable.Range(i, 10 - i)
select new { i, j, n = i * j })
.ToList()
.ForEach(x =>
{
Console.CursorLeft = x.i * 5;
Console.CursorTop = x.j * 2;
Console.Write("{0}", x.n);
});
Console.ReadKey();
}
}
}
试过了你的代码,是对的呢。就是不知道你的算式完整输出是个什么意思? --------------------编程问答-------------------- 未来的码农。。。建议自己在纸上独立完成再上机。。那样还有救。。 --------------------编程问答-------------------- 码农弟弟,这种题还是自己做比较好。
补充:.NET技术 , C#