Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int Fahrenheit = 0;
- Console.WriteLine("Whilelal:");
- Console.WriteLine("Fahrenheit: \tCelsius:");
- while (Fahrenheit <= 300)
- {
- double Celsius = (double)((Fahrenheit - 32) * (5.0 / 9));
- //int Celsius = (int)((Fahrenheit - 32) * (5.0 / 9)); //Castolás.
- //C#-ban nincs automata tipuskonverzió kisebbre, kényszeríteni kell a konverziókat.
- //pl int a = (int)(5.5*66);
- //char b = (char)(a*(65*453.0));
- Console.WriteLine("{0,10} \t {1,6:##0.00}", Fahrenheit, Celsius);
- //Kompozit formátum
- //printf C#-ban... persze ez is vacak. -_-
- //Inkább közelebb áll a BASIC PRINT USING-jához, tbh.
- Fahrenheit += 20;
- }
- Console.WriteLine("\nDo-whilelal:");
- Fahrenheit = 0;
- do
- {
- double Celsius = (double)((Fahrenheit - 32) * (5.0 / 9));
- //int Celsius = (int)((Fahrenheit - 32) * (5.0 / 9)); //Castolás.
- //C#-ban nincs automata tipuskonverzió kisebbre, kényszeríteni kell a konverziókat.
- //pl int a = (int)(5.5*66);
- //char b = (char)(a*(65*453.0));
- Console.WriteLine("{0,10} \t {1,6:##0.00}", Fahrenheit, Celsius);
- Fahrenheit += 20;
- } while (Fahrenheit <= 300);
- Console.WriteLine("\nForral:");
- for (Fahrenheit = 0; Fahrenheit <= 300; Fahrenheit += 20)
- {
- double Celsius = (double)((Fahrenheit - 32) * (5.0 / 9));
- //int Celsius = (int)((Fahrenheit - 32) * (5.0 / 9)); //Castolás.
- //C#-ban nincs automata tipuskonverzió kisebbre, kényszeríteni kell a konverziókat.
- //pl int a = (int)(5.5*66);
- //char b = (char)(a*(65*453.0));
- Console.WriteLine("{0,10} \t {1,6:##0.00}", Fahrenheit, Celsius);
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement