Ortaya çıkması ve yüzdesini göstermesi beklenen her 200 olasıdan 3 puan alan bu programa sahibim. ama sayıları girdiğimde cevap olarak 00.0 aldım. Neyi yanlış yapabilirim?C# 'de Basit Matematik Sayı #
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int Score1;
int Score2;
int Score3;
Console.Write("Enter your score (out of 200 possible) on the first test: ");
Score1 = int.Parse(Console.ReadLine());
Console.Write("Enter your score (out of 200 possible) on the second test: ");
Score2 = int.Parse(Console.ReadLine());
Console.Write("Enter your score (out of 200 possible on the third test: ");
Score3 = int.Parse(Console.ReadLine());
Console.WriteLine("\n");
float percent = ((Score1+ Score2+ Score3)/600);
Console.WriteLine("Your percentage to date is: {0:00.0}", percent);
Console.ReadLine();
}
}
}
Neden? Bunu 33 saniyeden daha kısa sürede nasıl yazabildiniz? : -P – Patrick
@Patrick: Buradan ilk satır: http://meta.stackexchange.com/questions/9134/jon-skeet-facts/9135#9135;) – Bobby
Bu sanırım C'nin en acımasız tuzaklarından biridir. -deri dillerin ifade sözdizimi ... – sum1stolemyname