Skip to content

Instantly share code, notes, and snippets.

View kehanlu's full-sized avatar
:shipit:

Kehan Lu kehanlu

:shipit:
View GitHub Profile
import socket
import subprocess
serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serverADDR = ('172.20.10.3', 8785) # host, port
print(" Server on {}".format(serverADDR))
serverSocket.bind(serverADDR)
serverSocket.listen(5)
@kehanlu
kehanlu / 1046.c
Last active October 25, 2016 17:25
#include <stdio.h>
#include <stdlib.h>
int cmp(const void *s1, const void *s2)
{
return *(char *)s2 - *(char *)s1;
}
int main(){
int n;
int start,end,K;
#include "stdio.h"
#include "string.h"
int main(){
char a[1000];
while(fgets(a,1000,stdin)!=NULL){
int space=0;
int letter =0;
if(a[0]==' ')
space--;
for(int i=0;i<strlen(a);i++){