ХошиСимидзу
04.06.2023 02:53

Write a program that reports whether or not someone is old enough to vote in the U.S. You should do the following in your program: Ask the user for their age, and store it in a variable
Use an if/else statement with the proper comparison operator to print You are old enough to vote!
if the person’s age is at least 18, and You are not old enough to vote. otherwise
An example run of your program might look like this:
Age: 19 You are old enough to vote!
… or like this:
Age: 16 You are not old enough to vote


Write a program that reports whether or not someone is old enough to vote in the U.S. You should do

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
gorbunovayulia
03.12.2022 02:08
#include <stdio.h>
#include <math.h>
struct prm {
    float a, b, c;
};
 
struct tch {
    float x, y;
};
 
void Peres2(struct prm a, struct prm b, struct tch *t) {
    t->x = (b.c*a.b-a.c*b.b)/(a.a*b.b-a.b*b.a);
    t->y = (b.a*a.c-a.a*b.c)/(a.a*b.b-a.b*b.a);
}
 
int Prov(struct prm a, struct prm b) {
    return a.a*b.b-a.b*b.a!=0;
}
 
void Vvod(struct prm *a, int k) {
    do {
        printf("Введите коэффициенты прямой %i\n", k);
        scanf("%f%f%f", &a->a, &a->b, &a->c);
        if ((a->a == 0) && (a->b == 0))
            printf("Это не прямая, повторите ввод\n");
    } while ((a->a == 0) && (a->b == 0));
    a->c = -a->c;
}
 
struct prm a, b, c;
struct tch m12, m13, m23;
float s;
 
int main() {
    Vvod(&a, 1);
    Vvod(&b, 2);
    Vvod(&c, 3);
    if (!Prov(a, b) || !Prov(a, c) || !Prov(b, c)) {
        printf("Прямые попарно не пересекаются");
        return 0;
    }
    Peres2(a,b,&m12);
    Peres2(a,c,&m13);
    Peres2(b,c,&m23);
 
    printf("Точка пересечения 1-2: %5.2f; %5.2f\n", m12.x, m12.y);
    printf("Точка пересечения 1-3: %5.2f; %5.2f\n", m13.x, m13.y);
    printf("Точка пересечения 2-3: %5.2f; %5.2f\n", m23.x, m23.y);
 
    s = fabs(m12.x*(m23.y-m13.y)+m23.x*(m13.y-m12.y)+m13.x*(m13.y-m23.y))/2;
    printf("Площадь треугольника пересечений=%.2f", s);
    return 0;
}
0,0(0 оценок)
Ответ:
VladislavAkinshin
04.02.2021 18:07
// PascalABC.NET 3.2, сборка 1467 от 02.06.2017
// Внимание! Если программа не работает, обновите версию!

begin
  var s:=ReadlnString('>');
  var k:=s.Length mod 4;
  if k>0 then s:=(4-k)*'0'+s;
  var a:=s.Batch(4).Select(c->c.JoinIntoString(''));
  foreach var t in a do
    case t of
    '0000':Write('0');
    '0001':Write('1');
    '0010':Write('2');
    '0011':Write('3');
    '0100':Write('4');
    '0101':Write('5');
    '0110':Write('6');
    '0111':Write('7');
    '1000':Write('8');
    '1001':Write('9');
    '1010':Write('A');
    '1011':Write('B');
    '1100':Write('C');
    '1101':Write('D');
    '1110':Write('E');
    '1111':Write('F');
    end;
  Writeln  
end.

Пример
> 110101111010101100010101110101101011011011
35EAC575ADB
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота