Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АрхитектураБиологияГеографияДругоеИностранные языки
ИнформатикаИсторияКультураЛитератураМатематика
МедицинаМеханикаОбразованиеОхрана трудаПедагогика
ПолитикаПравоПрограммированиеПсихологияРелигия
СоциологияСпортСтроительствоФизикаФилософия
ФинансыХимияЭкологияЭкономикаЭлектроника

Given a year number. Output the number of days of that year.



Task 1:

Given a year number. Output the number of days of that year.

Example:
Input:
1900

Output
365

Example:
Input:
2012

Output
366

 

Task2:

Given three natural numbers a, b, c which represent the day, month and year of some date. Output “yes" if the given date is correct and “no” otherwise.

Example:
Input:
32 1 1991

Output
no

 

Task3:

Write a program that asks the user's name, and then greets the user by name. Before outputting the user's name, convert it to upper case letters. For example, if the user's name is Fred, then the program should respond "Hello, FRED, nice to meet you!".

 

Task4:

 

Given natural number n. Calculate the expression shown on image

 

Example:
Input:
1
Output:
1.41421

Example:
Input:
2
Output:
1.84776

 

Task5:

Given natural number n. Calculate n!.
n! = 1*2*3*...*n.
Note: 0! = 1.

Example:
Input:
4
Output:
24

 

Task 6:


Write a program that reads one line of input text and breaks it up into words. The words should be output one per line. A word is defined to be a sequence of letters. Any characters in the input that are not letters should be discarded. For example, if the user inputs the line

 

He said, "That's not a good idea."

 

then the output of the program should be

 

He

said

that

s

not

a

good

idea

 

 


Дата добавления: 2015-11-04; просмотров: 247 | Нарушение авторских прав




<== предыдущая лекция | следующая лекция ==>
· In-memory Buffers (e.g. arrays) | 

mybiblioteka.su - 2015-2024 год. (0.006 сек.)