0
点赞
收藏
分享

微信扫一扫

scanf

看山远兮 2023-06-18 阅读 56


// scanfXS.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main(int argc, char* argv[])
{
	int i;
	char buff[256];

	printf("please input an int number:\n");
	scanf("%x",&i);
    printf("i=%x\n",i);
	printf("please input a  string:\n");
	scanf("%s",buff);
    printf("string=%s\n",buff);

	return 0;
}
/*
please input an int number:
0xad
i=ad
please input a  string:
qwert321
string=qwert321
Press any key to continue
please input an int number:
ad
i=ad
please input a  string:
asdfg
string=asdfg
Press any key to continue
*/



举报

相关推荐

0 条评论