Witam.
Nie wiem gdzie mam błąd jeśli chodzi o to zadanie :
http://pl.spoj.com/problems/AL_06_01/
Dostaję błędną odpowiedź.
Kod :
// SPOJ.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int numberOfNumvers;
cin >> numberOfNumvers;
long int a, b;
int tmp = numberOfNumvers;
int tmpResult;
while (tmp--)
{
cin >> a;
cin >> b;
if (a < 0)
a = (-1) * a;
if (b < 0)
b = (-1) * b;
cout << a % b << endl;
}
return 0;
}