<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/css.css" />
<style>
.css01{
background-image: url(img/01.png);
}
</style>
<script>
// 无论link还是<style></style>,从前往后依次是0,1,2……
alert(document.styleSheets[0].rules[0].style.backgroundImage);
alert(document.styleSheets[1].rules[0].style.backgroundImage);
</script>
</head> <body>
<input type="file" id="inputFile" onchange="GetFilePath()" />
</body>
</html>
相关文章
- 分布式到底是个啥
- C语言求100以内的全部素数,每行输出10个。素数就是只能被1和自身整除的正整数,1不是素数,2是素数。要求定义和调用函数prime(m)判断m是否为素数,当m为素数时返回1,否则返回0。
- #include <> typedef struct Node { int index; struct Node *next; }JosephuNode; int Josephu(int n, int m) { int i, j; JosephuNode *head, *tail; head = tail = (JosephuNode *)malloc(sizeof(JosephuNode)); for (i = 1; i < n; ++i) { tail->index = i; tail->next = (JosephuNode *)malloc(sizeof(JosephuNode)); tail = tail->next; } tail->index = i; tail->next = head; for (i = 1; tail != head; ++i) { for (j = 1; j < m; ++j) { tail = head; head = head->next; } tail->next = head->next; printf("第%4d个出局的人是:%4d号\n", i, head->index); free(head); head = tail->next; } i = head->index; free(head); return i; } int main { int n, m; scanf("%d%d", &n, &m); printf("最后胜利的是%d号!\n", Josephu(n, m)); system("pause"); return 0; }">设编号为1,2,… n的n个人围坐一圈,约定编号为k(1数组实现: #include <> #include <> int Josephu(int n, int m) { int flag, i, j = 0; int *arr = (int *)malloc(n * sizeof(int)); for (i = 0; i < n; ++i) arr[i] = 1; for (i = 1; i < n; ++i) { flag = 0; while (flag < m) { if (j == n) j = 0; if (arr[j]) ++flag; ++j; } arr[j - 1] = 0; printf("第%4d个出局的人是:%4d号\n", i, j); } free(arr); return j; } int main { int n, m; scanf("%d%d", &n, &m); printf("最后胜利的是%d号!\n", Josephu(n, m)); system("pause"); return 0; } 链表实现: #include <> #include <> typedef struct Node { int index; struct Node *next; }JosephuNode; int Josephu(int n, int m) { int i, j; JosephuNode *head, *tail; head = tail = (JosephuNode *)malloc(sizeof(JosephuNode)); for (i = 1; i < n; ++i) { tail->index = i; tail->next = (JosephuNode *)malloc(sizeof(JosephuNode)); tail = tail->next; } tail->index = i; tail->next = head; for (i = 1; tail != head; ++i) { for (j = 1; j < m; ++j) { tail = head; head = head->next; } tail->next = head->next; printf("第%4d个出局的人是:%4d号\n", i, head->index); free(head); head = tail->next; } i = head->index; free(head); return i; } int main { int n, m; scanf("%d%d", &n, &m); printf("最后胜利的是%d号!\n", Josephu(n, m)); system("pause"); return 0; }
- 面试必考真题-算法篇:给一个01矩阵,1代表是陆地,0代表海洋, 如果两个1相邻,那么这两个1属于同一个岛。我们只考虑上下左右为相邻
- 设a、b、c均是0到9之间的数字,abc、bcc是两个三位数,且有:abc+bcc=532。求满足条件的所有a、b、c的值。
- Vue 命名视图是个啥?
- dev/watchdog和dev/watchdog0 是同一个设备
- =0; i--)
{
printf("%d", a[i]);
if(i>0)
printf(" ");
else
printf("\n");
}
return 0;
}
转载于:/6bing/p/
">输入包括两行,第一行是一个正整数N(N
#include<>
int a[1100001];
int pp(int low,int h)
{
int key=a[low];
while(low < h)
{
while(key <= a[h] && low < h) h--;
a[low]=a[h];
while(key >= a[low] && low < h) low++;
a[h]=a[low];
}
a[low]=key;
return low;
}
void paixu(int low, int h)
{
if(low>=h)
return ;
int mid=pp(low,h);
paixu(low,mid-1);
paixu(mid+1,h);
}
int main
{
int i;
int n;
scanf("%d",&n);
for(i=0;i
=0; i--) { printf("%d", a[i]); if(i>0) printf(" "); else printf("\n"); } return 0; } 转载于:/6bing/p/ - jQuery中的‘$‘是个啥?
- c语言中1
1先转成二进制 在左移n位 然后补0
比如 1<<2 1的二进制为 0000 0001 左移2位 0000 0100.
n=1 即 1*2 , n=2 既1*2*2 ,n=3 既1*2*2*2
就是进行二进制的翻倍。
二进制每左移一位就是*2,两位就是*2*2,三位就是*2*2*2.
1>>n就是1右移n位
n>>1就是n右移1位
1<