Gaby Ivanushka(快排)
2024-10-10 12:07:12
Gaby Ivanushka
Once upon a time there lived a tsar that has a daughter — Beautiful Vasilisa. There were many of the young men that wanted to marry her but she repelled all suitors. The tsar was tired of her jigs, he got angry and issued an order: "The first who solves my puzzle, will marry Vasilisa!" Ivanushka decided to try his fortune. He came to the tsar and the tsar told him: "This is a program for you. Input N numbers and the program will tell you who you should marry. I give you a day to think." Ivanuska looked at the program and got upset: there were unknown letters, omnifarious symbols. The time passed. Ivanushka has thought out nothing.
The program was as follows.
The C program | The Pascal program |
---|---|
#include <stdio.h> |
var A:array [1..N] of |
Now you know this program. You may try to help Ivanushka.
Input
The first line of an input contains a positive number N ≤ 1000.
Output
You are to write to an output N numbers in one line. The tsar's program given those numbers should output a message "Beautiful Vasilisa" The numbers should be separated with a space. If several variants are possible choose any you like.
Example
input | output |
---|---|
3 |
3 7 19 |
//代码就是快排。
输出一个等差数列即可
#include <stdio.h>
int main()
{
int n;
while (scanf("%d",&n)!=EOF)
{
int i;
for (i=;i<n;i++)
printf("%d ",i);
printf("%d\n",i);
}
}
最新文章
- Linux &; Systemd 挂载问题解决
- Quartz.NET总结(一)入门
- POJ 2411 Mondriaan&;#39;s Dream
- windows all version - 实现指定路径共享
- 运行最快的安卓模拟器VirtualBox安装教程
- Microsoft.SharePoint.Security的问题
- grunt--自动化打包工具使用
- InstallShield -6109
- .net core 依赖注入扩展,实现随处控制反转
- ansible源码安装
- MySQL分支Percona
- Gym - 100971J (思维+简单bfs)
- MFC坐标转换
- Android (Android Studio)无法启动adb 解决方案
- C#简单窗体应用程序(二)
- angularJS1笔记-(12)-自定义指令(compile/link)
- [LeetCode 题解]: Linked List Cycle II
- System.Web.Caching.Cache类 缓存 各种缓存依赖(转)
- JavaScript学习记录总结(八)——全选、反选
- zigbee之MAC地址发送