Şimdiye kadar her şeyi nasıl yapacağımı anladım ama bu kodun bu şekilde nasıl davranacağını bilmem gerekiyor.C# Toplam dışlama
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
*
//and now the reverse
*
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
Anahtar da böyle dışarı çıkmasına neden oluyor? 5'de başlamayı ve 2 tam sayı almayı düşünüyorum ama onu izlemekte zorlanıyorum. Şimdiye kadar talep ettiğim iki çözüm için şimdiye kadar sahip olduğum şey.
//CIS 110 Program 7
//Online
using System;
class Program7
{
static int count, sum, countmax;
static void Main()
{
GetData();
}
static void GetData()
{
count = 0;
sum = 0;
countmax = 10;
while (count <= countmax)
{
while (sum <= count)
{
sum++;
Console.Write('*');
}
Console.WriteLine();
count++;
sum = 0;
}
}
}
//*
//**
//***
//****
//*****
//******
//*******
//********
//*********
//**********
//***********
//Press any key to continue . . .
//CIS 110 Program 7
//Online
using System;
class Program7
{
static int count, sum, countmax;
static void Main()
{
GetData();
}
static void GetData()
{
count = 9;
sum = 0;
while (count >= 0)
{
while (sum <= count)
{
sum++;
Console.Write('*');
}
Console.WriteLine();
count--;
sum = 0;
}
}
}
//**********
//*********
//********
//*******
//******
//*****
//****
//***
//**
//*
//Press any key to continue . . .
Neden sadece programlama dersten tam soru gönderebilir? 15 yıl önce uni'de bu alıştırmaları yaptığımı hatırlıyorum. Ne yazık ki, zaten sizin için ev ödevlerinizi isteyerek yapıyorsunuz. – Brad