Предмет: Информатика, автор: karpkoi2005

Пожалуйста очень надо. Пришлите либо фото либо напишите программу здесь

Приложения:

Аноним: На каком языке?
karpkoi2005: Паскаль наверное
Аноним: почему "наверное"?

Ответы

Автор ответа: Аноним
1

var a:integer;

begin

   write('Введите трёхзначное число: ');

   readln(a);

   if (a >= 100) and (a <= 999) then

       writeln((a div 100) + (a mod 10))

   else writeln('Ошибка! Это не трёхзначное число.');

end.

Приложения:
Автор ответа: LRSM
0

Ответ:

  • var s,n: integer;
  • begin
  • read(n);
  • s := n div 100 + n mod 10;
  • write(s);
  • end.

или более гибкий вариант, складывает первую и последнюю цифру числа независимо от того, трёхзначное число или нет:

  • var n: integer;
  • begin
  • read(n);
  • Print(n.ToString.First.ToDigit + n.ToString.Last.ToDigit);
  • end.

Пример работ:

Приложения:
Похожие вопросы
Предмет: Английский язык, автор: lusia01
Вместо точек вставьте где требуется, артикли а, an, the или местоимения some и any:

1.Has ... postman come yet? I am expecting ... letter from my father. 2. ... captain ordered ... crew to unload ... vessel. 3. My brother can drive ... car. 4 I got ... interesting book from our library... librarian said that I could keep it only for ... week as ... teacher of English also wanted it. 5. How can you say such … things? 6. There is … meeting in . .. conference hall this evening. 7. When ... moon passes between ...earth and ... sun ... eclipse results. 8. There is ... red book and ... green book on ... table in ... dining room. Will you bring me ... green one, please? 9 Can you tell me how to get to ... theatre? Go straight down ... street until you come to ... bridge. Then turn to ... right and you will see ... large white building. That is … theatre. 10. He brought ... books from ... library. 11. … department store is ... shop where all kinds of ... things are sold. 12. I know .., students of that institute. 13. I want to write ... letter to my sister. Have you ... fountain pen? 14. How brilliantly ... stars shine. 15. ... low stone wall separated… house from ....road. 16. He asked ... teacher ... question. 17. He received ... letters from Leningrad yesterday. 18. Are there ... pictures in this magazine? 19. He is reading “An American Tragedy", ... novel by Theodore Dreiser. 20. … door opened and ... man entered …room. He was ... man of about 50 years of age. 21. ... lion is ... large powerful animal. 22. There are many schools for …iblind in our country. 23. Petrov, ... captain of ... s. s. "Minsk”, is ... very good seaman. 24. ... telegram was addressed to C. D. Ivanov, ... Chairman of Sojuzimport.