几道 C 语言面试题
1.
int main()
{
int i, n = 20;
for (i = 0; i < n; i--)
printf("*");
return 0;
}
Change/add only one character and print '*' exactly 20 times.
(there are atleast 3 solutions to this problem :-)
2. display below like:
1
212
32123
4321234
543212345
3. search for maximum and minimum value, before save into arrange for any 5 natural number (use multiful for grammer)
ex)
save to any 5 natural number
30 20 75 15 64 <enter>
minimum : 15
maximum : 75
4. use ms-sql of join grammer. show query fot result
Table.1
ac_country
--------------------------------------
country_cd country_nm
--------------------------------------
kor koera
jpn japan
usa usa
cha china
Table.2
ac_currency1
-------------------------------------------
country_cd currency_cd currency_nm
-------------------------------------------
kor won W
jpn yen Y
usa usd US
# Result
-------------------------------------------
country_nm currency_cd currency_nm
-------------------------------------------
korea won W
japan yen Y
usa usd US
Result Query :
5.use ms-sql of join grammer. show query fot result
table.1
account
--------------------------------------
userid cost date
--------------------------------------
use01 10,000 2007-01-02
use02 5,000 2007-01-03
use05 7,000 2007-01-03
use03 5,000 2007-01-03
use01 5,000 2007-01-04
use04 5,000 2007-01-05
use02 10,000 2007-01-05
use01 1,000 2007-01-05
table.2
userinfo
-----------------------------------------------
code userid money register
-----------------------------------------------
AAA use01 8,500 2007-01-02
AAA use02 5,000 2007-01-03
AAA use03 2,000 2007-01-04
AAA use04 4,500 2007-01-05
BBB use05 5,500 2007-01-02
table.3
stateinfo
-------------------------------------
connect state indate
-------------------------------------
AAA-use01 Yes 2007-01-03
AAA-use02 No 2007-01-05
AAA-use03 No 2007-01-04
AAA-use04 Yes 2007-01-05
BBB-use05 NO 2007-01-04
#result
----------------------------------------------------------
userid money account_count account_total state
----------------------------------------------------------
use01 8,500 3 16,000 Yes
use02 5,000 2 15,000 No
use03 2,000 1 5,000 No
use04 4,500 1 5,000 Yes
Result Query :
6. show 2 query each fot result.A, result.B
table.data_table
-----------------------
F_DATE
-----------------------
2007-04-17 11:42:55.200
2007-04-18 01:45:33.403
2007-04-18 01:47:01.500
2007-04-17 11:40:15.000
2007-04-18 11:41:25.700
2007-04-18 11:41:49.420
2007-04-17 11:44:58.000
2007-04-18 11:45:23.340
#Result.A
----------
F_DATE
----------
2007-04-17
2007-04-18
Result Query :
#Result.B
----------
F_DATE
----------
2
Result Query :
参考:
http://community.csdn.net/Expert/topicview1.asp?id=5538039
http://blog.csdn.net/zpwmail/archive/2007/05/21/1619154.aspx
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!