测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A62500. 阅读C++程序填写结果#include<bits/stdc++.h>using namespace std;int main(){ int x,y, k; scanf("%d%d%d", &x, &y, &k); for(int i = 1; i <=k && x != y; ++i){ …

编程题

题目描述

阅读C++程序填写结果

#include<bits/stdc++.h>

using namespace std;

int main()

{

    int x,y, k;

scanf("%d%d%d", &x, &y, &k);

for(int i = 1; i <=k && x != y; ++i){

        if(x>y)x--y;

        else y-= x;

    }

    printf("%d %d\n",x,y);

    return 0;

}