Latihas的南方孤岛
Latihas的南方孤岛

课代表查人助手

最近在上网课,老师后台能看到谁没交作业谁没上线,最后基本是一份excel表格发到课代表手里让课代表查谁没交。由于没交的基本是个位数,所以盯着眼睛疼,做了个自动程序找出谁不在。

Java版

话不多说先上代码

package com.latihas.NameCompare;

import javax.swing.*;
import java.awt.*;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) {
		JFrame jFrame = new JFrame();
		JPanel jPanel = new JPanel();
		JButton jButton = new JButton("Start");
		
		TextArea textlistExp = new TextArea("在这里输入全部名单"),
				textlistNow = new TextArea("在这里输入有的名单"),
				textlistAbs = new TextArea("让我康康谁不在");
		
		jButton.addActionListener(v -> {
			String listNow = textlistNow.getText();
			StringBuilder blistAbs = new StringBuilder();
			System.out.println(Arrays.toString(textlistExp.getText().split("\r\n")));
			for (String s : textlistExp.getText().split("\r\n"))
				if (!listNow.contains(s))
					blistAbs.append(s).append("\r\n");
			textlistAbs.setText(blistAbs.toString());
		});
		
		jPanel.add(textlistExp);
		jPanel.add(textlistNow);
		jPanel.add(textlistAbs);
		jPanel.add(jButton);
		jFrame.add(jPanel);
		jFrame.setVisible(true);
		jFrame.pack();
	}
}

效果图

http://www.latihas.top/wp-content/uploads/2020/03/TIM截图20200302160225-1024x158.png
http://www.latihas.top/wp-content/uploads/2020/03/TIM截图20200302160627-1-1024x158.png

C++版

不是所有牛奶都是特仑苏,也不是所有电脑都装了jre,所以用c++可以解决不同电脑上的代码运行问题。 上代码

#include<bits/stdc++.h>

using namespace std;

int main() {
	cout << "请这里输入全部名单,以0结尾:" << endl;
	string ans;
	set<string> exp;
	string now;
	while (true) {
		string tmp;
		cin >> tmp;
		if (tmp == "0")break;
		exp.insert(tmp);
	}

	cout << "在这里输入有的名单,以0结尾:" << endl;
	while (true) {
		string tmp;
		cin >> tmp;
		if (tmp == "0")break;
		now+=tmp;
	}
	
	for(set<string>::iterator i=exp.begin();i!=exp.end();i++)
		if(now.find(*i)==-1)ans+=*i+"\n";
	
	cout <<"不见的:\n"<<ans;
	system("pause");
	return 0;
}

效果图

http://www.latihas.top/wp-content/uploads/2020/03/TIM图片20200302160912.png

Latihas

文章作者

发表评论

textsms
account_circle
email

  • Noble6

    英语课代表表示交了的是个位数

    1年前 回复
  • Mijn zoontje vindt doeboeken en puzzelboekjes sinds kort erg leuk. Met deze boekjes komen we de vakantie wel door! Kan hij net als mama puzzelen. Wynn Dewey Emeline

    6月前 回复
  • Pretty! This has been a really wonderful post. Thanks for providing this info. Doralia Paddy Marr

    6月前 回复
  • Hello, its fastidious article about media print, we all understand media is a impressive source of facts. Elle Lyman Marinna

    6月前 回复
  • Thanks so much for the post. Really looking forward to read more. Great. Johnna Hube Minoru

    6月前 回复
  • Very interesting topic , regards for putting up. “Men who never get carried away should be.” by Malcolm Forbes. Nelle Donovan Mady

    6月前 回复
  • Duis vitae eleifend orci, ut varius risus. Praesent consequat nibh id dictum molestie. Cras eget sapien auctor, porttitor nisi vitae, vulputate justo. Kissiah Neal Pitchford

    6月前 回复
  • Some genuinely select articles on this website , saved to fav. Gus Iosep Calli

    6月前 回复
  • I must thank you for the efforts you have put in writing this website. Desirae Jeno Dobson

    6月前 回复
  • Really informative blog article. Thanks Again. Really Great. Ailey Alexander Sarkaria

    6月前 回复
  • If some one wants expert view regarding running a blog afterward i advise him/her to visit this blog, Keep up the nice work. Pamelina Fons Giesecke

    6月前 回复
  • Very interesting subject , thankyou for posting. Evy Lemar Godrich

    6月前 回复
  • Every as soon as inside a when we pick blogs that we read. Listed beneath are the newest sites that we pick out. Lily Melvin Amaris

    5月前 回复
  • Way cool! Some extremely valid points! I appreciate you writing this write-up and the rest of the site is really good. Dari Christophorus Prima

    5月前 回复
  • I think what you wrote made a great deal of sense. Rozalie Alonzo Veal

    5月前 回复
  • kalau dijumlahkan ala kebulatan, anton honifar mengekspos bertambah berasal tentang 5 kiat menurut memihak sisipan heboh ini. tapi dalam tulisan ini, penauis hanya akan merandau 3 kiat juga. mau padatib serupa bersama dengan anton hanifar yang sanggup capai dupaan miliun berasal atas game slot online dolar88? karenanya bermainlah dengan strategi dengan penuh antisipasi. sungguh-sungguh, jikalau kemudian-baru main-main slot online dolar88, kita tak bakal terang strategi beserta kiat apa yg inciaksud. bagi maka, lebih baik main-main gambling slot mata uang88 ala rutin karena dengan seperti itu, sungaian dapat menjadi bertambah kenal bersama strategi atraksinya. namun, tak tersedia lupanya mengapa belajar dari oknum yang udah rupanya sukses di waktu bermain gambling slot online mata uang88. galat mono-nya begitulah, sih anton hanifar ini. abdi mata uang88 telah berkeinginan kepada ia berkenaan murusan trick bermain slot mata uang88. kelihatannyaan dapat melanjutkan eja tulisan ini bagi paham sulit kabir ratusan juta dari slot dolar88. Annabel Elvin Belvia

    4月前 回复
  • Everything is very open with a really clear explanation of the issues. Ceil Cort Marcos

    4月前 回复
  • I pay a quick visit every day some web sites and websites to read content, but this webpage presents feature based posts. Susan Geordie Sachs

    4月前 回复
  • I have a son who is retired from the military and is also a USAA member. Will I quality to become a member? Karel Waverly Emili

    4月前 回复
  • Hope these tips will come handy to you!! Wish you the best. Carmelita Auberon Alica

    4月前 回复
  • I was curious if you ever thought of changing the layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two pictures. Maybe you could space it out better? Roze Royce Landmeier

    4月前 回复
  • magnificent points altogether, you just won a new reader. What might you recommend about your publish that you just made a few days ago? Any certain? Sisile Tammie Schulz

    4月前 回复
  • I do believe all of the ideas you have introduced in your post. They are really convincing and will certainly work. Nonetheless, the posts are very short for beginners. Could you please extend them a bit from next time? Thank you for the post. Annette Killy Couture

    4月前 回复
  • Simply wanna remark on few general things, The website design is perfect, the content is very great : D. Tallulah Maurise Gilberte

    4月前 回复
  • Very good blog post. I definitely love this website. Stick with it! Albertina Broddie Sully

    4月前 回复
  • Splendid work on behalf of the owner of this web site, superb post. Zea Jeromy Freda

    4月前 回复
  • Absolutely written written content, Really enjoyed looking at. Adorne Gamaliel Krefetz

    4月前 回复
  • Ana Presente! May she rest in power always. I love her!! Mary Kerr Mab

    4月前 回复
  • Appreciate you sharing, great blog. Really looking forward to read more. Want more. Zonda Bentley Brunhilde

    4月前 回复
  • Ya William, you are correct. You have to go past the mind to truly rise above being controlled by the biases of the mind! Ines Dame Rinaldo

    4月前 回复
  • Took me time to read all the comments, but I really enjoyed the article. It proved to be Pretty helpful to me and I am positive to all the commenters here It is always nice when you can not only be informed, but also entertained Im positive you had fun writing this post. Lurleen Quentin Nicolea

    4月前 回复
  • Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. Edwina Brit Wilber

    4月前 回复
  • Well, that made me thirsty.!Great reviews and I love your expression on the gins and not as read from a connisuer! Thank you Antonia Rogers Layne

    4月前 回复
  • Thanks-a-mundo for the blog post. Really thank you! Will read on Carlene Addy Fleming

    4月前 回复
  • Excellent article! We are linking to this particularly great article on our site. Keep up the great writing. Dyann Saxon Jameson

    4月前 回复
  • Alacakaranlik Safak Vakti izle, Alacakaranlik Safak Vakti full izle, Alacakaranlik Safak Vakti t�rk�e dublaj izle, Alacakaranlik Safak Vakti hd izle, The Twilight Saga: Breaking Dawn – Part 1 izle, Sonunda iki asik bela ve edward evlenmek’dedir. Edward ile Jacop arasinda bir se�im bir se�im yapmak zorunda kalan bela tercihini tutkuyla asik oldugu edward’dan yana kullanmaktadir. Film Bela ve Edward’in �evresinde d�nerken esrarengiz olaylar olur ikili tatildeyken �ocuklarinin olacaginin farkina varir bu olay akillara sigmayacak bir sey vampir adam ve insan kani tasiyan kisin �ocuklari olmasi bu konuyu aile ile konusmak isteyen ikili bakalim ne diyecekler nasil bir durum ortaya �ikacaktir. Daryl Aguste Arline

    4月前 回复

Latihas的南方孤岛

课代表查人助手
最近在上网课,老师后台能看到谁没交作业谁没上线,最后基本是一份excel表格发到课代表手里让课代表查谁没交。由于没交的基本是个位数,所以盯着眼睛疼,做了个自动程序找出谁不在。 J…
扫描二维码继续阅读
2020-03-02