1-кодами
2-разрядами
3-цифрами
4-коэффицентами
Uses crt;
var input, betw:integer;
begin
readln(input);
betw := input;
betw := betw div 10;
betw := betw div 10;
betw := betw div 10;
writeln('Тысяч = ', betw);
betw := input;
betw := betw div 10;
betw := betw div 10;
betw := betw mod 10;
writeln('Сотен = ', betw);
betw := input;
betw := betw div 10;
betw := betw mod 10;
writeln('Десятков = ', betw);
betw := input;
betw := betw mod 10;
writeln('Единиц = ', betw); end.
С++
#include <iostream>
using namespace std;
bool Election(int a,int b,int c)
{
int t=0,f=0;
if(a==true)
t++;
else
f++;
if(b==true)
t++;
else
f++;
if(c==true)
t++;
else
f++;
if(t>f)
return TRUE;
else
return FALSE;
}
void main()
{
bool x,y,z;
cin>>x,y,z;
cout<< Election(x,y,z) <<endl;
system("pause");
}
Using System;
namespace Cars{ public enum Direction { Left, Right }
public class TurnEventArgs : EventArgs { public TurnEventArgs(Direction direction) { Direction = direction; }
public Direction Direction { get; } }
public abstract class Car { public event EventHandler Started; public event EventHandler Stopped; public event EventHandler<TurnEventArgs> Turned;
public int Speed { get; set; } public string Color { get; set; } public string Name { get; set; } public virtual bool IsPolice => false;
public void Go() { Started?.Invoke(this, EventArgs.Empty); }
public void Stop() { Stopped?.Invoke(this, EventArgs.Empty); }
public void Turn(Direction direction) { Turned?.Invoke(this, new TurnEventArgs(direction)); } }
public class TownCar : Car { }
public class SportCar : Car { }
public class WorkCar : Car { }
public class PoliceCar : Car { public override bool IsPolice => true; }}