0 xychan_official

学生身份

我要认证

暂无相关简介

等级
TA的排名 4w+

C语言-编写程序,定义一个含有15个元素的数组,并编写函数分别完成以下操作:

(1)调用C库函数中的随机函数给所有元素赋以0~49的随机数;(2)输出数组中元素的值;(3)按顺序对每三个数求一个和数,并传回主函数;(4)最后输出所有求出的和值。#include<stdio.h>#include "stdlib.h"#define SIZE 15#define N 3void getrand(int *,int);void getave(int *,int *,int);void priarr(int *,int);main(){ int x[SI

2020-07-10 13:01:19

Java语言-GenSetExample.java

import java.util.*;public class GenSetExample { public static void main(String[] args) { // TODO Auto-generated method stub Set<String> set=new HashSet<String>(); set.add("one"); set.add("second"); set.add("3rd"); System.out.print

2020-07-04 15:58:42

Java语言-Test2.java

interface Collection<A>{ public void add(A x); public Iterator<A> iterator();}interface Iterator<A>{ public A next(); public boolean hasNext();}@SuppressWarnings("serial")class NoSuchElementException extends RuntimeException{}cl

2020-07-04 15:52:46

Java语言-Test1.java

import javax.xml.soap.Node;interface Collection{ public void add(Object x); public Iterator iterator();}interface Iterator{ public Object next(); public boolean hasNext();}class NoSuchElementException extends RuntimeException{}class LinkedList i

2020-07-04 15:39:57

Java语言-Hashtable2.java

import java.util.*;public class Hashtable2 { @SuppressWarnings("unchecked") public static void main(String[] args) { // TODO Auto-generated method stub @SuppressWarnings("rawtypes") Hashtable balance=new Hashtable(); String str; double bal;

2020-06-22 14:33:01

Java语言-Hashtable1.java

import java.util.*;public class Hashtable1 { @SuppressWarnings("unchecked") public static void main(String[] args) { // TODO Auto-generated method stub @SuppressWarnings("rawtypes") Hashtable balance=new Hashtable(); @SuppressWarnings("rawtypes"

2020-06-20 12:00:59

Java语言-IceCream.java

import java.io.*;@SuppressWarnings("unused")public class IceCream { static String[] breed={"巧克力","香草","草莓","朗姆酒","咖啡","果仁","香芋","绿茶","榛子","葡萄干"}; static String[] breedSet(int n) { n=Math.abs(n)%(breed.length+1); String[] results=new String[n]; in

2020-06-18 10:09:53

Java语言-VectorExample.java

import java.util.*;public class VectorExample { @SuppressWarnings("unchecked") public static void main(String[] args) { // TODO Auto-generated method stub @SuppressWarnings("rawtypes") Vector v=new Vector(2,1); System.out.println("矢量初始大小:"+v.siz

2020-06-18 09:51:39

Java语言-ListExample.java

import java.util.*;public class ListExample { @SuppressWarnings("unchecked") public static void main(String[] args) { // TODO Auto-generated method stub @SuppressWarnings("rawtypes") List l=new ArrayList(); l.add("欢迎您"); l.add("学习"); l.add("

2020-06-16 09:06:52

Java语言-SetExample.java

import java.util.*;public class SetExample { @SuppressWarnings("unchecked") public static void main(String[] args) { // TODO Auto-generated method stub int numArgs=args.length; @SuppressWarnings("rawtypes") Set encountered=new HashSet(); for(i

2020-06-15 23:40:11

Java语言-IteratorExample.java

import java.util.*;public class IteratorExample { public static void main(String[] args) { // TODO Auto-generated method stub Collection intList=new ArrayList();//创建一个列表数组 int[] values= {9,11,-4,1,13,99,1,0};//包装成整数对象 //将当前整数值对象加入列表数组 for(int i

2020-06-15 23:23:15

Java语言-JOptionPaneDemo.java

import javax.swing.*;public class JOptionPaneDemo { public static void main(String[] args) { // TODO Auto-generated method stub JOptionPane.showMessageDialog(null, "消息类型是:Information Message","第一条消息",JOptionPane.INFORMATION_MESSAGE); JOptionPane.sh

2020-06-14 21:52:03

Java语言-Trees.java

import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.tree.*;class Branch{ DefaultMutableTreeNode r;//DefaultMutableTreeNode是树的数据结构中的通用节点,节点也可以有多个子节点 public Branch(String[] data) { r=new DefaultMutableTreeNode(data[0]);

2020-06-14 16:35:09

Java语言-SwingApplication.java

import javax.swing.*;//引入Swing包名import java.awt.*;import java.awt.event.*;public class SwingApplication { private static String labelPrefix="Number of button clicks:"; private int numClicks=0;//计数器,计算点击次数 public Component createComponents() { final

2020-06-12 09:27:25

Java语言-HelloWorldSwing.java

import javax.swing.*;public class HelloWorldSwing { public static void main(String[] args) { // TODO Auto-generated method stub JFrame frame=new JFrame("Swing Application"); JLabel label=new JLabel("Hello World"); frame.getContentPane().add(label

2020-06-12 08:52:04

Java语言-TextEditor.java

import java.awt.*;import java.awt.event.*;import java.io.*;public class TextEditor { private Frame f; private MenuBar mb; private Menu mFile,mEdit,mHelp,mTools; private MenuItem mOpen,mSave,mExit,mCopy,mPaste,mReplace,mWeb,mPaint,mDefine; private F

2020-06-10 10:23:29

Java语言-MyCanvas.java

import java.awt.*;import java.awt.event.*;import java.util.*;@SuppressWarnings("unused")public class MyCanvas implements KeyListener,MouseListener { Canvas c;//声明一个画布对象 String s=""; public static void main(String[] args) { // TODO Auto-generated m

2020-06-10 09:42:32

Java语言-AnonymousClass.java

import java.awt.*;import java.awt.event.*;public class AnonymousClass { private Frame f; private TextField tf; public AnonymousClass() { f=new Frame("Inner classes example"); tf=new TextField(30); } public void launchFrame() { Label label=new

2020-06-10 09:23:01

Java语言-TestInnerClass.java

import java.awt.*;import java.awt.event.*;public class TestInnerClass { private Frame f; private TextField tf; public void launchFrame() { f=new Frame("Inner classes example"); tf=new TextField(30); Label label=new Label("Click and drag the mous

2020-06-09 22:06:23

Java面向对象程序设计——0609作业(读写文件)

1、定义学生类:属性:学号,姓名,学院,年级,班级定义构造方法,根据给定的学号,姓名给属性赋值;定义年级,学院,班级的getter和setter定义toString方法,将各个属性用逗号连接起来构成字符串并返回。public class Student { String ID,name,college,grade,Class; Student(String ID,String name){ this.ID=ID; this.name=name; } public String ge

2020-06-09 22:05:30

查看更多

勋章 我的勋章
  • 签到达人
    签到达人
    累计签到获取,不积跬步,无以至千里,继续坚持!
  • 新人勋章
    新人勋章
    用户发布第一条blink获赞超过3个即可获得
  • 阅读者勋章Lv2
    阅读者勋章Lv2
    授予在CSDN APP累计阅读博文达到7天的你,是你的坚持与努力,使你超越了昨天的自己。
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv4
    勤写标兵Lv4
    授予每个自然周发布9篇以上(包括9篇)原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。