حل السؤال
حل السؤال 15
import 'dart:io';
void main() {
stdout.write("Enter an integer N: ");
int N = int.parse(stdin.readLineSync()!);
stdout.write("Enter a single character: ");
String input = stdin.readLineSync() ?? '';
if (input.isEmpty || input.codeUnitAt(0) > 127) {
print('Invalid input: a nonempty string starting with ASCII required.');
return;
}
String character = input.substring(0, 1);
if (N <= 0) {
print("Please enter a positive integer for N.");
return;
}
String result = character * N;
print(result);
}

