首页 > printf的返回值
头像 大哥~
发表于 2020-03-12 18:34:43
这个题Java的好难啊,打印出来的是个PrintStream对象,然后一直都不行。看c函数返回的直接就是个int类型。是打印的字符串的长度,就直接用长度代替了 public class Main { public static void main(String[] args) { 展开全文
头像 牛客题解官
发表于 2020-06-04 17:03:08
分析: 本题考查printf函数的返回值,printf函数原型为int printf (char * format,args,···),返回值为输出的字符个数,如果出错则返回负数。 题解: #include <bits/stdc++.h> using namespace std; in 展开全文
头像 起名字太难了吧
发表于 2021-09-20 20:03:37
#include<stdio.h> int main() { int a=printf("Hello world!"); printf("\n%d",a); return 0; }
头像 黄华逸
发表于 2021-12-20 21:25:15
#include<stdio.h> int main() { int a=printf("Hello world!");//a被赋值为这函数 printf("\n%d",a);//当打印a时,a才被运行,即运行一次printf("Hello world!")这个部 展开全文
头像 牛客266442785号
发表于 2021-12-20 13:22:39
#include <stdio.h> int main() { int a=printf("Hello world!"); printf("\n"); printf("%d",a) ; return 0; } 事实上,我们看到,首先,我们定义一个a,在定义的同时,我们发现此时已经会打印一 展开全文
头像 匿名沉
发表于 2020-09-18 19:52:16
public class Main{ public static void main(String[] args) { String a="Hello world!"; System.out.println(a); System.out.prin 展开全文
头像 大力猪猪
发表于 2021-10-01 16:42:48
#include <stdio.h> int main(){ printf("\n%d",printf("Hello world!")); return 0; }
头像 هاوتشوان
发表于 2021-04-20 14:37:27
include <stdio.h> int main() { int ret = printf("Hello world!"); printf("\n"); printf("%d\n", ret); return 0;}
头像 小石_coding
发表于 2021-10-05 21:44:33
#include <iostream> #include <stdio.h> using namespace std; int main() { int len = printf("Hello world!"); printf("\n"); print 展开全文
头像 绿色菜狗的自我修养
发表于 2024-10-23 14:03:57
#include <stdio.h> int main() { printf("\n%d\n", printf("Hello world!")); return 0; }