9301 | 2024-02-20 11:40:59 | Leventusz09 | Sakktábla (75 pont) | cpp17 | Compilation error |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sakktáblatorta{
class Program{
static void Main(){
int[] in1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
int A = in1.Min();
int B = in1.Max();
if (B == 0){
Console.WriteLine(0);
return;
}
int tmin, i=0;
while(true){
tmin = i * i / 2;
if (A < tmin || B < tmin + 1) break;
i++;
}
Console.WriteLine(i-1);
}
}
}
exit status 1
main.cpp:1:4: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
main.cpp:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
main.cpp:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Linq;
| ^~~~~~
main.cpp:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Text;
| ^~~~~~
main.cpp:5:7: error: expected nested-name-specifier before 'System'
5 | using System.Threading.Tasks;
| ^~~~~~
main.cpp:28:6: error: expected ';' after class definition
28 | }
| ^
| ;
main.cpp: In static member function 'static void Sakkt\U000000e1blatorta::Program::Main()':
main.cpp:10:16: error: structured binding declaration cannot have type 'int'
10 | int[] in1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
| ^~
main.cpp:10:16: note: type must be cv...