Вот цитата на день рождения:
“Считайте свою жизнь улыбками, а не слезами. Считайте свой возраст друзьями, а не годами.”
Теперь перейдем к различным методам генерации кодов:
Метод 1: Python
def birthday_quote():
return "Count your life by smiles, not tears. Count your age by friends, not years."
print(birthday_quote())
Метод 2: JavaScript
function birthdayQuote() {
return "Count your life by smiles, not tears. Count your age by friends, not years.";
}
console.log(birthdayQuote());
Метод 3: Java
public class BirthdayQuote {
public static void main(String[] args) {
System.out.println(birthdayQuote());
}
public static String birthdayQuote() {
return "Count your life by smiles, not tears. Count your age by friends, not years.";
}
}
Метод 4: C#
using System;
public class Program
{
public static void Main()
{
Console.WriteLine(BirthdayQuote());
}
public static string BirthdayQuote()
{
return "Count your life by smiles, not tears. Count your age by friends, not years.";
}
}
Метод 5: Ruby
def birthday_quote
"Count your life by smiles, not tears. Count your age by friends, not years."
end
puts birthday_quote
Метод 6: PHP
function birthday_quote() {
return "Count your life by smiles, not tears. Count your age by friends, not years.";
}
echo birthday_quote();