فهرس الكتباللغة البرمجية دارت

حل السؤال

حل السؤال 53

import 'dart:io';
void main() {
  stdout.write("Enter the value of x: ");
  int x = int.parse(stdin.readLineSync()!);
  stdout.write("Enter the value of y: ");
  int y = int.parse(stdin.readLineSync()!);
  int max = x > y ? x : y;
  int min = x < y ? x : y;
  if (min == 0) {
    print('Invalid input: the modulus divisor must be nonzero.');
    return;
  }
  int result = max % min;
  print("$max mod $min = $result");
}
العودة إلى السؤال نفسه