PTA C语言实验
Wowblk
这个作者很懒,什么都没留下…
展开
-
实验8-1-7 数组循环右移 (20 分)
本题要求实现一个对数组进行循环右移的简单函数:一个数组a中存有n(>0)个整数,将每个整数循环向右移m(≥0)个位置,即将a中的数据由(a0a1⋯an−1)变换为(an−m⋯an−1a0a1⋯an−m−1)(最后m个数循环移至最前面的m个位置)。函数接口定义:int ArrayShift( int a[], int n, int m );其中a[]是用户传入的数组;n是数组的大小;m是右移的位数。函数ArrayShift须将循环右移后的数组原创 2021-05-21 19:52:22 · 565 阅读 · 0 评论 -
实验11-2-1 建立学生信息链表 (20 分)
void input() { struct stud_node* currentptr; int num = 0; scanf("%d",&num); while(num != 0){ currentptr = (struct stud_node*)malloc(sizeof(struct stud_node)); if(currentptr != NULL) { scanf("%s",¤tptr->name); scanf("%d",&...原创 2021-05-21 18:35:25 · 244 阅读 · 0 评论 -
实验1-1 Hello World! (5分)
#include<stdio.h>int main(){ printf("Hello World!\n");}在PTA 我做的第一道编程题北邮无名学子原创 2020-10-19 00:09:12 · 135 阅读 · 0 评论