#define M 100 // число
typedef unsigned int uint;
int main()
{
uint num[3];
for (int i = 0; i < 2; i++)
if ((double)M / 3 - M / 3 > 0.5)
num[i] = M / 3 + 1;
else
num[i] = M / 3;
num[2] = M - num[0] - num[1];
return 0;
}
// PascalABC.NET 3.4, сборка 1766 от 25.08.2018
begin
var n := ReadInteger('n->');
var (k, m) := (n mod 3, n div 3);
Println(k<=1?$'{m} {m} {n-2*m}':$'{m} {m + 1} {m + 1}');
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#define M 100 // число
typedef unsigned int uint;
int main()
{
uint num[3];
for (int i = 0; i < 2; i++)
if ((double)M / 3 - M / 3 > 0.5)
num[i] = M / 3 + 1;
else
num[i] = M / 3;
num[2] = M - num[0] - num[1];
return 0;
}
// PascalABC.NET 3.4, сборка 1766 от 25.08.2018
begin
var n := ReadInteger('n->');
var (k, m) := (n mod 3, n div 3);
Println(k<=1?$'{m} {m} {n-2*m}':$'{m} {m + 1} {m + 1}');
end.