打印长整型时出错 我是C++新手。我编写了一个使用无符号long-long-int数据类型的程序

打印长整型时出错 我是C++新手。我编写了一个使用无符号long-long-int数据类型的程序,c++,printf,long-long,C++,Printf,Long Long,我无法正确打印变量 代码如下: #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <math.h> using namespace std; int main() { /* Enter your code here. Read input from STDI

我无法正确打印变量

代码如下:

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <math.h> 
using namespace std;


int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
    int t ;
    int x = scanf("%d",&t);

     unsigned long long int a,b,c;
     unsigned long long int counter,n ,mod = pow(10,9)+7;

    while (t>0){
        int y = scanf("%llu,%llu,%llu",&a,&b,&n); 
        //printf("%llu\n",a);
         if (n == 1){
                printf("%llu",b);
            }else if (n == 0){
                printf("%llu",a);
            }else{
                 c = 0;
             counter =2;
            while (counter <= n){
                c = a+b;
                a = b;
                b = c;
                ++counter;
            }
            if (c>mod)
                c=c-mod;
            printf("%llu",c);
         }
        --t;
    }    
    return 0;
}
预期产出:

3
85
25
178
8
8
3
44
23191798
观测输出:

3
85
25
178
8
8
3
44
23191798

与Java的
println
函数不同,
printf
不添加换行符。
如果您希望它这样做,请在字符串中添加一个'\n'

printf("some text\n");

当使用调试器单步执行代码时,您观察到了什么?我正在在线IDE中编写代码。我不能在那里使用调试器。为什么要投否决票?我还是个新手,也许我遗漏了什么“也许我遗漏了什么”是的,调试。SO不是在线调试服务。我知道SO不是在线调试服务。但我想知道怎么了。我是C++新手,如果我做了一年左右,我不会发布这个问题。我用java学习C++后4年。如果有人能指导我找到解决方案,我将不胜感激。您没有打印任何换行符('\n')。