Составить алгоритм(как я понимаю, схему) программы.
вот :
дано трехзначное число. найти в нем число тысяч, десятков и единиц.
вот составленная мной программа( в лазарусе):
var unitscount,
tenscount,
hundredscount,
number : integer;
begin
readln(number);
unitscount : = number mod 10;
tenscount : = (number div 10) mod 10;
hundredscount : = number div 100;
writeln('count of units: ', unitscount);
writeln('count of tens: ', tenscount);
writeln('count of thoudands: ', hundredscount);
end.
составить !
using namespace std;
int main()
{
int N;
cout<<"N=";
cin>>N;
int X[N];
for (int i=0; i<N; i++)
{
setlocale (LC_CTYPE, "Russian");
cout<<"eoa cia?aiea "<<i<<" yeaiaioa ianneaa";
while (!(cin>>X[i]))
{
cin.clear();
while (cin.get() !='\n');
cout<<"eoa cia?aiea "<<i<<" yeaiaioa ianneaa";
}
}
cout<<"Enoiaiue iannea:"<<endl;
for (int i=0; i<N; i++)
cout<<"X["<<i<<"]="<<X[i]<<endl;
bool prostoe [N+1];
for (int i=2; i<=N+1; i++)
prostoe[i]=true;
for (int i=2; i<=N; i++)
{
if (prostoe[i])
{
for (int j=i*i; j<=N; j+=i)
prostoe [j]=false;
}
}
for (int i=2; i<=N; i++)
if (prostoe[i])
cout<<i<<endl;